Пример #1
0
def test_none_getSessionDetails(
  dynamo_client, table_init, table_name, session
):
  client = DynamoClient( table_name )
  result = client.getSessionDetails( session )
  assert 'error' in result.keys()
  assert result['error'] == 'Session not in table'
Пример #2
0
def test_getSessionDetails(dynamo_client, table_init, table_name, visitor,
                           browsers, visits, session):
    client = DynamoClient(table_name)
    client.addVisitor(visitor)
    client.addNewSession(visitor, browsers, visits)
    result = client.getSessionDetails(session)
    assert 'visits' in result.keys()
    assert all([
        dict(result['visits'][index]) == dict(visits[index])
        for index in range(len(visits))
    ])
    assert 'session' in result.keys()
    assert result['session'].ip == visitor.ip
    assert result['session'].sessionStart == visits[0].date