def test_event_params_invalid_rem_fields(): """ When end_date is invalid then through value error. """ from AgariPhishingDefense import get_events_params args = {'rem_fields': 'id,created_at'} with pytest.raises(ValueError) as e: get_events_params(args=args) assert str(e.value) == 'Cannot pass "id" in rem_fields argument.'
def test_event_params_invalid_page_id(): """ When page_id is negative then through value error. """ from AgariPhishingDefense import get_events_params args = {'page_id': '-1', 'limit': '50'} with pytest.raises(ValueError) as e: get_events_params(args=args, max_record=200) assert str(e.value) == 'Argument page_id must be a positive integer.'
def test_event_params_invalid_end_date(): """ When end_date is invalid then through value error. """ from AgariPhishingDefense import get_events_params args = {'end_date': 'end_date'} with pytest.raises(ValueError) as e: get_events_params(args=args) assert str(e.value) == 'The given value for end_date argument is invalid.'
def test_event_params_invalid_limit(): """ When limit is negative or greater than 200 then through value error. """ from AgariPhishingDefense import get_events_params args = {'limit': '2as'} with pytest.raises(ValueError) as e: get_events_params(args=args, max_record=200) assert (str(e.value) == 'Argument limit must be a positive integer between 1 to 200.')