def test_add_repo_checks_for_duplicates(self, _validate_repo_mock): _validate_repo_mock.return_value = '' cli.add_repo('tests/data') cli.add_repo('tests/data') with open(self.path) as config: self.assertEqual(loads(config.read())['repositories'], ['tests/data'])
def test_add_repo(self): path = cli.init() cli.add_repo('agrc/forklift') with open(path) as config: self.assertEqual(['agrc/forklift'], loads(config.read())['repositories'])
def test_add_repo_checks_for_duplicates(self, _validate_repo_mock): _validate_repo_mock.return_value = '' cli.add_repo('tests/data') cli.add_repo('tests/data') with open(self.path) as config: self.assertEqual( loads(config.read())['repositories'], ['tests/data'])
def test_add_repo_invalid(self): result = cli.add_repo('bad/repo') self.assertIn('[Invalid repo name or owner]', str(result))
def test_add_repo_invalid(self): result = cli.add_repo('bad/repo') self.assertIn('[Invalid repo name or owner]', result)