Skip to content

Instantly share code, notes, and snippets.

@jasongorman
Created October 4, 2019 07:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasongorman/ad01d4bdc6ab2e4208050f1f31715921 to your computer and use it in GitHub Desktop.
Save jasongorman/ad01d4bdc6ab2e4208050f1f31715921 to your computer and use it in GitHub Desktop.
def test_sales_sent_to_charts(self):
song = 'How Do You Sleep: Sam Smith'
all_sales = [
Sale(song)
]
charts_mock = Charts()
from unittest.mock import MagicMock
charts_mock.send = MagicMock()
daily_sales = DailySongSales(all_sales, charts_mock)
daily_sales.sales_of(song)
charts_mock.send.assert_called_with(song, 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment