示例#1
0
    def test__monthly_total(self) -> None:
        # Arrange
        data = copy.deepcopy(PYTHON_MINOR_DATA)

        # Act
        output = pypistats._monthly_total(data)

        # Assert
        assert len(output) == 64

        assert output[0]["category"] == "2.4"
        assert output[0]["downloads"] == 1
        assert output[0]["date"] == "2018-04"

        assert output[10]["category"] == "2.7"
        assert output[10]["downloads"] == 489_163
        assert output[10]["date"] == "2018-05"
示例#2
0
    def test__monthly_total(self):
        # Arrange
        data = copy.deepcopy(PYTHON_MINOR_DATA)

        # Act
        output = pypistats._monthly_total(data)

        # Assert
        self.assertEqual(len(output), 64)

        self.assertEqual(output[0]["category"], "2.4")
        self.assertEqual(output[0]["downloads"], 1)
        self.assertEqual(output[0]["date"], "2018-04")

        self.assertEqual(output[10]["category"], "2.7")
        self.assertEqual(output[10]["downloads"], 489_163)
        self.assertEqual(output[10]["date"], "2018-05")