Ejemplo n.º 1
0
class TestLibraryManager(unittest.TestCase):
    def setUp(self):
        self.library_path = 'path/to/library/'
        self.glm = GitbergLibraryManager()
        self.glm.config.data = {'library_path': self.library_path}

    def test_library_base_path_from_config(self):
        self.assertEqual(self.glm.library_base_path, self.library_path)

    def test_book_directories(self):
        with patch('os.listdir', return_value=[1, 2, 3, 4]) as _mock:
            self.glm.book_directories()
            _mock.assert_called_with(self.library_path)
Ejemplo n.º 2
0
class TestLibraryManager(unittest.TestCase):
    def setUp(self):
        self.library_path = 'path/to/library/'
        self.glm = GitbergLibraryManager()
        self.glm.config.data = {
            'library_path': self.library_path
        }

    def test_library_base_path_from_config(self):
        self.assertEqual(
            self.glm.library_base_path,
            self.library_path
        )

    def test_book_directories(self):
        with patch('os.listdir', return_value=[1, 2, 3, 4]) as _mock:
            self.glm.book_directories()
            _mock.assert_called_with(self.library_path)
Ejemplo n.º 3
0
 def setUp(self):
     self.library_path = 'path/to/library/'
     self.glm = GitbergLibraryManager()
     self.glm.config.data = {
         'library_path': self.library_path
     }
Ejemplo n.º 4
0
 def setUp(self):
     self.library_path = 'path/to/library/'
     self.glm = GitbergLibraryManager()
     self.glm.config.data = {'library_path': self.library_path}