def test_user_can_be_read(api, account, account_params, acc_user): read = account.users.read(acc_user.entity_id) asserts.assert_resource(read) asserts.assert_resource_params(read, account_params) read = api.account_users.read(acc_user.entity_id) asserts.assert_resource(read) asserts.assert_resource_params(read, account_params)
def test_user_can_be_read_by_name(api, account, account_params, acc_user): user_name = acc_user['username'] read = account.users[user_name] asserts.assert_resource(read) asserts.assert_resource_params(read, account_params) read = api.account_users[user_name] asserts.assert_resource(read) asserts.assert_resource_params(read, account_params)
def test_should_update_method(method, updated_method_params): resource = method.update(params=updated_method_params) asserts.assert_resource(resource) asserts.assert_resource_params(resource, updated_method_params)
def test_should_update_backend_usage(backend_usage, backend_updated_usage_params): resource = backend_usage.update(params=backend_updated_usage_params) asserts.assert_resource(resource) asserts.assert_resource_params(resource, backend_updated_usage_params)
def test_should_create_backend_usage(backend_usage, backend_usage_params): asserts.assert_resource(backend_usage) asserts.assert_resource_params(backend_usage, backend_usage_params)
def test_should_create_mapping_rule(backend_mapping_rule, backend_mapping_rule_params): asserts.assert_resource(backend_mapping_rule) asserts.assert_resource_params(backend_mapping_rule, backend_mapping_rule_params)
def test_service_can_be_read(api, service_params, service): read = api.services.read(service.entity_id) asserts.assert_resource(read) asserts.assert_resource_params(read, service_params)
def test_policy_registry_can_be_read(api, policy_registry_params, policy_registry): read = api.policy_registry.read(policy_registry.entity_id) asserts.assert_resource(read) asserts.assert_resource_params(read, policy_registry)
def test_provider_account_can_be_read(api, provider_account, provider_account_params): account = api.provider_accounts.read(provider_account.entity_id) asserts.assert_resource(account) asserts.assert_resource_params(account, provider_account_params)
def test_should_create_metric(metric, metric_params): asserts.assert_resource(metric) asserts.assert_resource_params(metric, metric_params)
def test_should_update_metric(metric, updated_metric_params): resource = metric.update(params=updated_metric_params) asserts.assert_resource(resource) asserts.assert_resource_params(resource, updated_metric_params)
def test_should_read_metric(metric, metric_params): resource = metric.read() asserts.assert_resource(resource) asserts.assert_resource_params(resource, metric_params)
def test_account_can_be_created(api, account, account_params): asserts.assert_resource(account) asserts.assert_resource_params(account, account_params)
def test_account_can_be_read_by_name(api, account, account_params): account_name = account['org_name'] read = api.accounts[account_name] asserts.assert_resource(read) asserts.assert_resource_params(read, account_params)
def test_account_can_be_read(api, account, account_params): read = api.accounts.read(account.entity_id) asserts.assert_resource(read) asserts.assert_resource_params(read, account_params)
def test_should_update_metric(backend_metric, backend_updated_metric_params): resource = backend_metric.update(params=backend_updated_metric_params) asserts.assert_resource(resource) asserts.assert_resource_params(resource, backend_updated_metric_params)
def test_should_create_metric(backend_metric, backend_metric_params): asserts.assert_resource(backend_metric) asserts.assert_resource_params(backend_metric, backend_metric_params)
def test_provider_user_can_be_created(provider_account, provider_account_params): asserts.assert_resource(provider_account) asserts.assert_resource_params(provider_account, provider_account_params)
def test_policy_regitry_can_be_read_by_name(api, policy_registry_params, policy_registry): name = policy_registry['name'] read = api.policy_registry[name] asserts.assert_resource(read) asserts.assert_resource_params(read, policy_registry)
def test_application_plan_can_be_created(service, application_plan_params, application_plan): asserts.assert_resource(application_plan) asserts.assert_resource_params(application_plan, application_plan_params)
def test_service_can_be_read_by_name(api, service_params, service): account_name = service['system_name'] read = api.services[account_name] asserts.assert_resource(read) asserts.assert_resource_params(read, service_params)
def test_application_plan_can_be_read_by_name(service, application_plan_params, application_plan): name = application_plan['name'] read = service.app_plans[name] asserts.assert_resource(read) asserts.assert_resource_params(read, application_plan)
def test_should_read_mapping_rule(backend_mapping_rule, backend_mapping_rule_params): resource = backend_mapping_rule.read() asserts.assert_resource(resource) asserts.assert_resource_params(resource, backend_mapping_rule_params)
def test_application_plan_can_be_updated(service, application_plan, update_params): updated_app_plan = application_plan.update(update_params) asserts.assert_resource(updated_app_plan) asserts.assert_resource_params(updated_app_plan, update_params)
def test_should_read_backend_usage(backend_usage, backend_usage_params): resource = backend_usage.read() asserts.assert_resource(resource) asserts.assert_resource_params(resource, backend_usage_params)
def test_activedoc_can_be_read(api, active_docs_params, active_doc): read = api.active_docs.read(int(active_doc.entity_id)) asserts.assert_resource(read) asserts.assert_resource_params(read, active_docs_params)
def test_should_read_method(method, method_params): resource = method.read() asserts.assert_resource(resource) asserts.assert_resource_params(resource, method_params)
def test_activedoc_can_be_read_by_name(api, active_docs_params, active_doc): account_name = active_doc['system_name'] read = api.active_docs[account_name] asserts.assert_resource(read) asserts.assert_resource_params(read, active_docs_params)
def test_should_create_method(method, method_params): asserts.assert_resource(method) asserts.assert_resource_params(method, method_params)
def test_should_read_metric(backend_metric, backend_metric_params): resource = backend_metric.read() asserts.assert_resource(resource) asserts.assert_resource_params(resource, backend_metric_params)