X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=tests%2Ftest_format.py;h=2710af97a1bbc236c83df28195c8c8c8a95b3e09;hb=e19edc2c673b2f672d613c97bce91c0ec238e80a;hp=8dc1a2294f79523c0d8970f82b1b4aba273a4097;hpb=475190458d53b61efeede03e6c417ef7ef7b8357;p=m_librarian.git diff --git a/tests/test_format.py b/tests/test_format.py old mode 100755 new mode 100644 index 8dc1a22..2710af9 --- a/tests/test_format.py +++ b/tests/test_format.py @@ -1,18 +1,17 @@ -#! /usr/bin/env python - +import os import unittest -from tests import main -from m_librarian import config, download +from m_librarian import download +from m_librarian.config import get_config class TestFormat(unittest.TestCase): def test_compile_format(self): - config.get_config().set('download', 'format', '%a/%s/%n %t') + config_path = os.path.join( + os.path.dirname(__file__), 'test_config.conf') + get_config(config_path) + ml_conf = get_config() + ml_conf.set('download', 'format', '%a/%s/%n %t') download._compile_format() self.assertEqual(download.compiled_format, u'%(author)s/%(series)s/%(ser_no)d %(title)s') - - -if __name__ == "__main__": - main()