def test_remove_non_existent(self): """ Tests removing a path that isn't in the file does not throw an error. """ # Setup f = ProtectedRepoListingFile(TEST_FILE) f.add_protected_repo_path('foo', 'repo1') self.assertEqual(1, len(f.listings)) # Test f.remove_protected_repo_path('bar') # should not error # Verify self.assertEqual(1, len(f.listings))
def test_remove_repo_path(self): """ Tests removing a repo path successfully removes it from the listings. """ # Setup f = ProtectedRepoListingFile(TEST_FILE) f.add_protected_repo_path('foo', 'repo1') self.assertEqual(1, len(f.listings)) # Test f.remove_protected_repo_path('foo') # Verify self.assertEqual(0, len(f.listings))