]> git.phdru.name Git - m_librarian.git/blobdiff - tests/test_format.py
Use pytest for testing
[m_librarian.git] / tests / test_format.py
old mode 100755 (executable)
new mode 100644 (file)
index 8dc1a22..2710af9
@@ -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()