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 )
def test_addLocation(table_name): result = DynamoClient(table_name).addLocation(location()) assert 'location' in result.keys() assert dict(result['location']) == dict(location())
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
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'
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'
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'
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'
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 )
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
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'
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 }'
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 }'
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
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'
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 )
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'
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'
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'
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 )
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'
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'
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'
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 )
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)
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'
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() }'
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 }'