-
-
Save jasongorman/7519dec03900e1931d8ae47928899897 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from pricer import Pricer | |
class VideoInfoStub(object): | |
def __init__(self, title, rating): | |
self.title = title | |
self.rating = rating | |
def fetch_video_info(self, imdbID): | |
return self.title, self.rating | |
class PricerTest(unittest.TestCase): | |
def test_price_high_rated_video(self): | |
video_info = VideoInfoStub('The Abyss', 7.1) | |
pricer = Pricer(video_info) | |
video = pricer.price('tt0096754') | |
self.assertEqual(4.95, video.price) | |
def test_price_medium_rated_video(self): | |
video_info = VideoInfoStub('Daddy Day Care', 5.5) | |
pricer = Pricer(video_info) | |
video = pricer.price('tt0317303') | |
self.assertEqual(3.95, video.price) | |
def test_price_low_rated_video(self): | |
video_info = VideoInfoStub('Manos: The Hand Of Fate', 1.9) | |
pricer = Pricer(video_info) | |
video = pricer.price('tt0060666') | |
self.assertEqual(2.95, video.price) | |
if __name__ == '__main__': | |
unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment