host = "http://example.com"
headers = {"Content-Type": "application/json"}
def send_http(self, data: dict):
response = requests.request(**data)
class ContainersApi(BaseApi):
def get_containers(self, namespace, limit=10):
url = f"{self.host}/api/{namespace}/containers?limit={limit}"
'headers': self.headers,
return self.send_http(data)
def test_get_containers():
response = api.get_containers(namespace="usr-xxx", limit=10)
assert response.status_code == 200