def test_set_immutable_property_now_empty(self): self._inject_mock_invalid_consumer() update_action = RepoUpdateActionCommand() existing_repo = Repo('testrepo') existing_repo['proxy_username'] = "******" incoming_repo = {} update_action.update_repo(existing_repo, incoming_repo) self.assertFalse("proxy_username" in list(existing_repo.keys()))
def test_set_immutable_property_now_not_in_cert(self): self._inject_mock_invalid_consumer() update_action = RepoUpdateActionCommand() existing_repo = Repo('testrepo') existing_repo['proxy_username'] = "******" incoming_repo = {} update_action.update_repo(existing_repo, incoming_repo) # Immutable properties should be always be added/updated, # and removed if undefined in the new repo definition. self.assertFalse("proxy_username" in list(existing_repo.keys()))
def test_set_mutable_property_now_not_in_cert(self): self._inject_mock_invalid_consumer() update_action = RepoUpdateActionCommand() existing_repo = Repo('testrepo') existing_repo['metadata_expire'] = "blah" incoming_repo = {} update_action.update_repo(existing_repo, incoming_repo) # re comments in repolib # Mutable properties should be added if not currently defined, # otherwise left alone. self.assertTrue("metadata_expire" in list(existing_repo.keys()))