Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
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)
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)