Exemple #1
0
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")
Exemple #2
0
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"
        }