예제 #1
0
def test_list_packages():
    r = CnrClient()
    with requests_mock.mock() as m:
        response = '{"packages": "true"}'
        m.get(DEFAULT_REGISTRY + DEFAULT_PREFIX + "/api/v1/packages",
              text=response)
        assert json.dumps(r.list_packages({})) == response
예제 #2
0
def test_list_packages_orga():
    r = CnrClient()
    with requests_mock.mock() as m:
        response = '{"packages": "true"}'
        m.get(DEFAULT_REGISTRY + DEFAULT_PREFIX +
              "/api/v1/packages?namespace=ant31",
              complete_qs=True,
              text=response)
        assert json.dumps(r.list_packages({'namespace': "ant31"})) == response