示例#1
0
def test_addPage( dynamo_client, table_init, table_name, year_visits, page ):
  result = DynamoClient( table_name ).addPage( year_visits )
  assert 'page' in result.keys()
  assert dict( result['page'] ) == dict( page )
示例#2
0
def test_addLocation(table_name):
    result = DynamoClient(table_name).addLocation(location())
    assert 'location' in result.keys()
    assert dict(result['location']) == dict(location())
示例#3
0
def test_addVisits( dynamo_client, table_init, table_name, visits ):
  result = DynamoClient( table_name ).addVisits( visits )
  assert 'visits' in result.keys()
  assert result['visits'] == visits
示例#4
0
 def test_table_listVisitors(self, table_name):
     result = DynamoClient(table_name).listVisitors()
     assert 'error' in result.keys()
     assert result['error'] == 'Could not get visitors from table'
示例#5
0
def test_table_addLocations(table_name):
    result = DynamoClient(table_name).addLocations(locations())
    assert 'error' in result.keys()
    assert result['error'] == 'Could not add locations to table'
def test_table_getPageDetails(table_name, page):
    result = DynamoClient(table_name).getPageDetails(page)
    assert 'error' in result.keys()
    assert result['error'] == 'Could not get page from table'
示例#7
0
 def test_none_getVisitorDetails(self, table_name, visitor):
     result = DynamoClient(table_name).getVisitorDetails(visitor)
     assert 'error' in result.keys()
     assert result['error'] == 'Visitor not in table'
示例#8
0
def test_table_updateSession(
  dynamo_client, table_name, browsers, visits, session
):
  result = DynamoClient( table_name ).updateSession( session, visits )
  assert 'error' in result.keys()
  assert result['error'] == 'Could not update session in table'
示例#9
0
def test_addYear( dynamo_client, table_init, table_name, year_visits, year ):
  result = DynamoClient( table_name ).addYear( year_visits )
  assert 'year' in result.keys()
  assert dict( result['year'] ) == dict( year )
示例#10
0
def test_addBrowsers( dynamo_client, table_init, table_name, browsers ):
  result = DynamoClient( table_name ).addBrowsers( browsers )
  assert 'browsers' in result.keys()
  assert result['browsers'] == browsers
示例#11
0
def test_table_getSessionDetails(
  dynamo_client, table_name, visitor, browsers, visits, session
):
  result = DynamoClient( table_name ).getSessionDetails( session )
  assert 'error' in result.keys()
  assert result['error'] == 'Could not get session from table'
示例#12
0
def test_none_removeBrowser(
  dynamo_client, table_init, table_name, browser
):
  result = DynamoClient( table_name ).removeBrowser( browser )
  assert 'error' in result.keys()
  assert result['error'] == f'Browser not in table { browser }'
示例#13
0
def test_none_removeSession(
  dynamo_client, table_init, table_name, session
):
  result = DynamoClient( table_name ).removeSession( session )
  assert 'error' in result.keys()
  assert result['error'] == f'Session not in table { session }'
示例#14
0
def test_addSession( dynamo_client, table_init, table_name, session ):
  result = DynamoClient( table_name ).addSession( session )
  assert 'session' in result.keys()
  assert result['session'] == session
示例#15
0
def test_table_addPage( dynamo_client, table_name, year_visits ):
  result = DynamoClient( table_name ).addPage( year_visits )
  assert 'error' in result.keys()
  assert result['error'] == 'Could not add new page to table'
示例#16
0
def test_addMonth( dynamo_client, table_init, table_name, month_visits, month ):
  result = DynamoClient( table_name ).addMonth( month_visits )
  assert 'month' in result.keys()
  assert dict( result['month'] ) == dict( month )
示例#17
0
def test_none_getPageDetails(table_name, page):
    result = DynamoClient(table_name).getPageDetails(page)
    assert 'error' in result.keys()
    assert result['error'] == 'Page not in table'
示例#18
0
def test_table_addMonth( dynamo_client, table_name, month_visits ):
  result = DynamoClient( table_name ).addMonth( month_visits )
  assert 'error' in result.keys()
  assert result['error'] == 'Could not add new month to table'
示例#19
0
 def test_none_decrementVisitorSessions(self, table_name, visitor):
     result = DynamoClient(table_name).decrementVisitorSessions(visitor)
     visitor.numberSessions += 1
     assert 'error' in result.keys()
     assert result['error'] == 'Visitor not in table'
示例#20
0
def test_addWeek( dynamo_client, table_init, table_name, week_visits, week ):
  result = DynamoClient( table_name ).addWeek( week_visits )
  assert 'week' in result.keys()
  assert dict( result['week'] ) == dict( week )
示例#21
0
 def test_table_getVisitorDetails(self, table_name, visitor):
     result = DynamoClient(table_name).getVisitorDetails(visitor)
     assert 'error' in result.keys()
     assert result['error'] == 'Could not get visitor from table'
示例#22
0
def test_table_addWeek( dynamo_client, table_name, week_visits ):
  result = DynamoClient( table_name ).addWeek( week_visits )
  assert 'error' in result.keys()
  assert result['error'] == 'Could not add new week to table'
示例#23
0
def test_table_listLocations(table_name):
    result = DynamoClient(table_name).listLocations()
    assert 'error' in result.keys()
    assert result['error'] == 'Could not get visits from table'
示例#24
0
def test_addDay( dynamo_client, table_init, table_name, day_visits, day ):
  result = DynamoClient( table_name ).addDay( day_visits )
  assert 'day' in result.keys()
  assert dict( result['day'] ) == dict( day )
示例#25
0
def test_batch_addLocations(table_name):
    result = DynamoClient(table_name).addLocations(locations() * 10)
    assert 'locations' in result.keys()
    assert len(result['locations']) == len(locations() * 10)
示例#26
0
def test_table_addDay( dynamo_client, table_name, day_visits ):
  result = DynamoClient( table_name ).addDay( day_visits )
  assert 'error' in result.keys()
  assert result['error'] == 'Could not add new day to table'
示例#27
0
def test_none_removeLocation(table_name):
    result = DynamoClient(table_name).removeLocation(location())
    assert 'error' in result.keys()
    assert result['error'] == f'Location not in table { location() }'
示例#28
0
def test_none_removeVisit(
  dynamo_client, table_init, table_name, visit
):
  result = DynamoClient( table_name ).removeVisit( visit )
  assert 'error' in result.keys()
  assert result['error'] == f'Visit not in table { visit }'