How to use the pypistats._grand_total function in pypistats

To help you get started, we’ve selected a few pypistats examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hugovk / pypistats / tests / test_pypistats.py View on Github external
def test__grand_total_recent(self):
        # Arrange
        data = copy.deepcopy(SAMPLE_DATA_RECENT)

        # Act
        output = pypistats._grand_total(data)

        # Assert
        self.assertEqual(output, SAMPLE_DATA_RECENT)
github hugovk / pypistats / tests / test_pypistats.py View on Github external
def test__grand_total_one_row(self):
        # Arrange
        data = copy.deepcopy(SAMPLE_DATA_ONE_ROW)

        # Act
        output = pypistats._grand_total(data)

        # Assert
        self.assertEqual(output, SAMPLE_DATA_ONE_ROW)
github hugovk / pypistats / tests / test_pypistats.py View on Github external
def test__grand_total(self):
        # Arrange
        data = copy.deepcopy(PYTHON_MINOR_DATA)
        original_len = len(data)

        # Act
        output = pypistats._grand_total(data)

        # Assert
        self.assertEqual(len(output), original_len + 1)
        self.assertEqual(output[-1]["category"], "Total")
        self.assertEqual(output[-1]["downloads"], 9_355_317)