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.*'\)")
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.*'\)")
def setUp(self): self.repo = Repository(TESTREPO_PATH)
def test_relative_path_raises_valueerror(self): with self.assertRaisesRegex(ValueError, 'path must be absolute'): Repository('relative/path/')
def test_empty_path_raises_valueerror(self): with self.assertRaisesRegex(ValueError, 'path must not be empty'): Repository('')
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)