Ejemplo n.º 1
0
def test_getPageDetails(table_name, year_visits, month_visits, week_visits,
                        day_visits, page):
    client = DynamoClient(table_name)
    client.addVisits(month_visits + year_visits + month_visits + week_visits +
                     day_visits)
    client.updatePage(month_visits + year_visits + month_visits + week_visits +
                      day_visits)
    result = client.getPageDetails(page)
    assert 'page' in result.keys() and 'days' in result.keys() and \
      'weeks' in result.keys() and 'months' in result.keys() and \
      'years' in result.keys()
Ejemplo n.º 2
0
def test_parameter_getPageDetails(table_name):
    client = DynamoClient(table_name)
    with pytest.raises(ValueError) as e:
        assert client.getPageDetails({})
    assert str(e.value) == 'Must pass a Page object'