Ejemplo n.º 1
0
def test_set_path_params_error(datadir):
    event = Event()
    with pytest.raises(AwAwsMissingRequirement, match='Event not set'):
        event.set_path_params()
Ejemplo n.º 2
0
def test_set_path_missing(datadir):
    apigw_event = json.loads(open(datadir.join('apigw_event_no_path.json'), 'rt').read())
    event = Event()
    event.set_event(apigw_event)
    event.set_path_params()
    assert event.path is None
Ejemplo n.º 3
0
def test_set_path_params(datadir):
    apigw_event = json.loads(open(datadir.join('apigw_event.json'), 'rt').read())
    event = Event()
    event.set_event(apigw_event)
    event.set_path_params()
    assert event.path == '/the/cool/path'