def test__date_range(self) -> None: # Arrange data = copy.deepcopy(PYTHON_MINOR_DATA) # Act first, last = pypistats._date_range(data) # Assert assert first == "2018-04-16" assert last == "2018-09-23"
def test__date_range(self): # Arrange data = copy.deepcopy(PYTHON_MINOR_DATA) # Act first, last = pypistats._date_range(data) # Assert self.assertEqual(first, "2018-04-16") self.assertEqual(last, "2018-09-23")
def test__date_range_no_dates_in_data(self) -> None: # Arrange # recent data = [{ "data": { "last_day": 70, "last_month": 445, "last_week": 268 }, "package": "dapy", "type": "recent_downloads", }] # Act first, last = pypistats._date_range(data) # Assert assert first is None assert last is None