Skip to content
Snippets Groups Projects
Commit ad9f5bc0 authored by Mike Sell's avatar Mike Sell
Browse files

Added implementation for Credential definitions scenarios

parent e72a849e
No related branches found
No related tags found
No related merge requests found
......@@ -2,17 +2,17 @@ from behave import *
import json
from helper import generate_random_string, post_credential_definition, list_credential_definitions
from init import step_init, step_register_issuer_did
from schema import post_schema_complete, error_409
@when(u'I register a credential definition')
def step_impl(context):
def post_credential_def(context):
response = post_credential_definition(context.schema_manager_base_URL,
context.issuer_id,
context.issuer_did,
context.schema_id)
assert response.status_code == 201
print(response.json()["data"]["credentialDefinitionId"])
context.credential_definition_id = response.json()["data"]["credentialDefinitionId"]
......@@ -22,35 +22,43 @@ def step_impl(context):
@when(u'I register a credential definition with a {schema_id}, {issuer_id}, and {issuer_did}')
def step_impl(context):
if issuer_id == False:
issuer_id = ""
else:
def step_impl(context, schema_id, issuer_id, issuer_did):
if issuer_id == True:
issuer_id = context.issuer_id
if issuer_did == False:
issuer_did = ""
else:
issuer_id = ""
if issuer_did == True:
issuer_did = context.issuer_did
else:
issuer_did = ""
if schema_id == False:
schema_id = ""
if schema_id == True:
schema_id = context.schema_id
else:
schema_id = str(context.schema_id)
schema_id = ""
context.bad_request_response = post_credential_definition(context.schema_manager_base_URL,
issuer_id,
issuer_did,
schema_id)
issuer_id,
issuer_did,
schema_id)
@given(u'I have a credential definition registered')
def step_impl(context):
raise NotImplementedError(u'STEP: Given I have a credential definition registered')
# Goes as far to create a new Schema with tenantDID+ID
post_schema_complete(context)
post_credential_def(context)
@when(u'I register the same credential definition')
def step_impl(context):
raise NotImplementedError(u'STEP: When I register the same credential definition')
context.conflict_response = post_credential_definition(context.schema_manager_base_URL,
context.issuer_id,
context.issuer_did,
context.schema_id)
@when(u'I list the credential definition')
......
from behave import *
import requests
import json
from helper import generate_random_string, register_endorser_did, create_issuer_tennant, register_issuer_did
......@@ -17,11 +15,13 @@ def step_init(context):
context.dev_tools_base_URL = localhost + "4100"
context.did_manager_base_URL = localhost + "4006"
# context.schema_manager_base_URL_2 = localhost + "4011"
# context.connection_manager_base_URL_2 = localhost + "4012"
# context.dev_tools_base_URL_2 = localhost + "4110"
# context.beta.schema_manager_base_URL = localhost + "4011"
# context.beta.connection_manager_base_URL = localhost + "4012"
# context.beta.credential_manager_base_URL = localhost + "4013"
# context.beta.proof_manager_base_URL = localhost + "4014"
# context.beta.dev_tools_base_URL = localhost + "4110"
# context.beta.did_manager_base_URL = localhost + "4016"
# Register Endorser DID
register_endorser_did(context.dev_tools_base_URL)
......
from behave import *
import requests
import json
from helper import generate_random_string, post_schemas, get_schemas
from init import step_init, step_register_issuer_did
......@@ -70,7 +69,7 @@ def step_impl(context):
)
@then(u'I get HTTP status code 409 Conflict.')
def step_impl(context):
def error_409(context):
assert context.conflict_response.status_code == 409
@given(u'I have a schema registered.')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment