Exemple #1
0
class RepositoryTest(TestCase):
    def setUp(self):
        self.repo = Repository(TESTREPO_PATH)

    def test_find_files(self):
        self.assertEqual(5, len(list(self.repo.find_files('*/task.md'))))
        self.assertEqual(4, len(list(self.repo.find_files('*/meta.json'))))

    def test_repo_path_and_path_s(self):
        self.assertEqual('testrepo', self.repo.path.name)
        self.assertTrue(self.repo.path_s.endswith('testrepo'))

    def test_repr(self):
        self.assertRegex(repr(self.repo), r"Repository\('.*testrepo.*'\)")
Exemple #2
0
class RepositoryTest(TestCase):
    def setUp(self):
        self.repo = Repository(TESTREPO_PATH)

    def test_find_files(self):
        self.assertEquals(5, len(list(self.repo.find_files("*/task.md"))))
        self.assertEquals(4, len(list(self.repo.find_files("*/meta.json"))))

    def test_repo_path_and_path_s(self):
        self.assertEqual("testrepo", self.repo.path.name)
        self.assertTrue(self.repo.path_s.endswith("testrepo"))

    def test_repr(self):
        self.assertRegex(repr(self.repo), r"Repository\('.*testrepo.*'\)")
Exemple #3
0
 def setUp(self):
     self.repo = Repository(TESTREPO_PATH)
Exemple #4
0
 def test_relative_path_raises_valueerror(self):
     with self.assertRaisesRegex(ValueError, 'path must be absolute'):
         Repository('relative/path/')
Exemple #5
0
 def test_empty_path_raises_valueerror(self):
     with self.assertRaisesRegex(ValueError, 'path must not be empty'):
         Repository('')
Exemple #6
0
 def test_load_tasks(self, mocked_logger, mocked_signal):
     load_tasks(Repository(TESTREPO_PATH))
     mocked_signal.send.assert_called_once()
     self.assertEqual(3, mocked_logger.error.call_count)
Exemple #7
0
 def setUp(self):
     self.repo = Repository(TESTREPO_PATH)