def setup_before_scenario(scenario):
    # make sure the auth cookie is cleared
    world.auth_cookie = None

    # @todo: DON'T NEED?????
    # dict of names of objects used in scenarios to remember from one step to the next keyed by type such as "user"
    world.names = {}

    # the id of the last referenced item of this tcm_type
    world.latest_of_type = {}

    if (world.restore_db):
        restore_db_state()

    if (world.use_mock):
        scenarioData = mock_scenario_data.get_scenario_data(scenario.name).strip()

        headers = {'content-Type':'text/plain',
                   "Content-Length": "%d" % len(scenarioData) }

        setup_connection()
        world.conn.request("POST",
                           add_params(world.path_mockdata,
                                      {"scenario" : scenario.name}),
                            "", headers)

        world.conn.send(scenarioData)
        world.conn.getresponse()
Пример #2
0
def setup_scenario_data(scenario):
    scenarioData = mock_scenario_data.get_scenario_data(scenario.name).strip() 

    headers = { 'content-Type':'text/plain',
            "Content-Length": "%d" % len(scenarioData) }

    setup_connection()
    world.conn.request("POST", "/api/v1/mockdata?scenario=" + urllib.quote(scenario.name), "", headers)

    world.conn.send(scenarioData)
    world.conn.getresponse()
Пример #3
0
def setup_scenario_data(scenario):
    if (world.use_mock):
        scenarioData = mock_scenario_data.get_scenario_data(scenario.name).strip() 
    
        headers = {'content-Type':'text/plain',
                   "Content-Length": "%d" % len(scenarioData) }
    
        setup_connection()
        world.conn.request("POST", add_params(world.path_mockdata, {"scenario" : scenario.name}), "", headers)
    
        world.conn.send(scenarioData)
        world.conn.getresponse()