def test_delete_package_unauthorized(): r = CnrClient() with requests_mock.mock() as m: response = '{"packages": "true"}' m.delete(DEFAULT_REGISTRY + DEFAULT_PREFIX + "/api/v1/packages/ant31/kube-ui/1.4.3/helm", complete_qs=True, text=response, status_code=401) with pytest.raises(requests.HTTPError): r.delete_package("ant31/kube-ui", "1.4.3", "helm")
def test_delete_package(): r = CnrClient() with requests_mock.mock() as m: response = '{"packages": "true"}' m.delete(DEFAULT_REGISTRY + DEFAULT_PREFIX + "/api/v1/packages/ant31/kube-ui/1.4.3/helm", complete_qs=True, text=response) assert r.delete_package("ant31/kube-ui", "1.4.3", "helm") == { "packages": "true" }