import os

from ..config import Config


class TestConfig:
    def test__from_file__renders_file_properly(self):
        # Test that __str__() renders file properly after reading
        # the configuration from file.
        sut = Config()
        path = os.path.dirname(__file__)
        sut.from_file(os.path.join(path, 'config-fixture.ini'))

        with open(os.path.join(path, 'config-expected.ini'), 'r') as f:
            expected = f.read()

        assert sut.__str__() == expected
