2014-09-01 3 views
-1

다른 다중 행 단계 정의에서 다중 행 정의를 호출하려고 시도합니다. lettuce.py 웹 사이트는 say에 거의 없습니다.다른 다중 행 단계 정의를 호출하는 다중 행 정의를 갖는 방법

@step(u'I create a "([^"]*)" with the definition:$') 
    def i_create_a_resource_with_the_definition(step, resource): 
     body = "" 

     if step.multiline != "": 
      definition = json.loads(step.multiline) 
      body = json.dumps(definition) 

     url = world.url + "/" + resource + "s" 

     world.response = world.perform_http_request(url = url, method = "POST", body = body) 

@step(u'I create a duplicate "([^"]*)" with the definition:$') 
    def i_create_a_duplicate_resource_with_the_definition(step, resource): 
     step.behave_as(""" 
      I create a "{resource}" with the definition: 
     """.format(resource = resource)) 

답변

0

이 문제는 관련 product입니다.

이 항목은 infoxchange/new-parser 분기에서 수정해야합니다. - Danielle Madeley

0

실제로 질문에 답변하지 않습니다.

@step(u'I "([^"]*)" (a|a duplicate) "([^"]*)" with the definition:$') 
def i_method_a_resource_with_the_definition(step, method, word, resource): 
    body = "" 

    if step.multiline != "": 
     definition = json.loads(step.multiline) 
     body = json.dumps(definition) 

    url = world.url + "/" + resource + "s" 

    world.response = world.perform_http_request(url = url, method = method, body = body) 

    if "location" in world.response.headers: 
     world.last_resource_identifier = world.response.headers[ "location" ] 

을 그리고 개발자와의 issue을 제기 : 우리는 다음과 같은 단계 정의와 순간을 진행했습니다.