def tenant(tenant_id=None): """ This fixture provisions a new tenant database. :param tenant_id: can be indirectly overridden with @pytest.mark.fixture decorator. """ if tenant_id is None: tenant_id = str(bson.objectid.ObjectId()) client = internal_api.InternalAPIClient() client.provision_tenant(new_tenant=internal_api.NewTenant(tenant_id=tenant_id)) yield tenant_id
def __init__(self, device_id=None, plan=None, tenant_id=None): if device_id is None: device_id = str(uuid.uuid4()) self.id = device_id self.tenant_id = tenant_id if tenant_id is None: tenant_id = "" self.plan = plan client = internal_api.InternalAPIClient() r = client.provision_device_with_http_info( tenant_id=tenant_id, device=internal_api.Device(device_id=device_id), _preload_content=False, ) assert r.status == 201
def test_internal_health(self): client = internal_api.InternalAPIClient() r = client.check_liveliness_with_http_info(_preload_content=False) assert r.status == 204