예제 #1
0
 def test_missing_thumbnail_picture(self):
     with open(os.path.join(TEST_PREFIX, "missing_all_thumbnail_show.json"),
               "r") as resp:
         show_data = json.loads(resp.read())
         show = models.Show(show_data)
         assert show.thumbnail is None
         assert show.get_thumbnail("lg") is None
예제 #2
0
 def test_regular_show(self):
     show_data = self.auth.get("https://roosterteeth.com/api/v1/shows/55")
     show = models.Show(show_data.json())
     # Test attributes
     assert show.id_ == 55
     assert show.season_count == 12
     assert show.summary == "Rooster Teeth's official game show!  A live half hour of fast-paced laughs as host Jon Risinger puts two RT teams on the spot for points and mayhem."
     assert show.canonical_url == "https://roosterteeth.com/show/on-the-spot"
     assert show.name == "On The Spot"
     assert show.thumbnail == "https://s3.amazonaws.com/rtv3.image.cdn.roosterteeth.com/store/e8d10356-958f-47c7-b66b-924d5bab5554.jpg/tb/OnTheSpotSquare.jpg"
     for quality in models.Thumbnail.qualities:
         assert show.get_thumbnail(
             quality
         ) == "https://s3.amazonaws.com/rtv3.image.cdn.roosterteeth.com/store/e8d10356-958f-47c7-b66b-924d5bab5554.jpg/{}/OnTheSpotSquare.jpg".format(
             quality)
     assert show.cover_picture == "https://s3.amazonaws.com/rtv3.image.cdn.roosterteeth.com/store/64f97401-2a32-4bbb-a9e6-5f9035fa680c.jpg/original/OnTheSpotHero2.jpg"
예제 #3
0
 def test_regular_show(self):
     with HTTMock(mock_shows.regular_show_response):
         show_data = requests.get(
             "https://roosterteeth.com/api/v1/shows/55")
         show = models.Show(show_data.json())
         # Test attributes
         assert show.id_ == 55
         assert show.season_count == 7
         assert show.summary == "Rooster Teeth's official game show!  A live half hour of fast-paced laughs as host Jon Risinger puts two RT teams on the spot for points and mayhem."
         assert show.canonical_url == "http://roosterteeth.com/show/on-the-spot"
         assert show.name == "On The Spot"
         assert show.thumbnail == "http://s3.amazonaws.com/cdn.roosterteeth.com/uploads/images/51f48d21-5c15-4211-b3e8-837386bf1b1a/tb/2037887-1467141869039-On_the_Spot_Podcast_Thumbnail.jpg"
         assert show.get_thumbnail(
             "sm"
         ) == "http://s3.amazonaws.com/cdn.roosterteeth.com/uploads/images/51f48d21-5c15-4211-b3e8-837386bf1b1a/sm/2037887-1467141869039-On_the_Spot_Podcast_Thumbnail.jpg"
         assert show.cover_picture == "http://s3.amazonaws.com/cdn.roosterteeth.com/uploads/images/14a811b0-b0f1-4b08-a65b-1c565d6d153f/original/21-1458935312881-ots_hero.png"
예제 #4
0
 def test_missing_cover_picture(self):
     with open(os.path.join(TEST_PREFIX, "missing_cover_picture_show.json"),
               "r") as resp:
         show_data = json.loads(resp.read())
         show = models.Show(show_data)
         assert show.cover_picture is None
예제 #5
0
 def test_missing_thumbnail_picture(self):
     with HTTMock(mock_shows.missing_all_thumbnail_show_response):
         show_data = requests.get(
             "https://roosterteeth.com/api/v1/shows/55")
         show = models.Show(show_data.json())
         assert show.get_thumbnail("lg") is None
예제 #6
0
 def test_missing_cover_picture(self):
     with HTTMock(mock_shows.missing_cover_picture_show_response):
         show_data = requests.get(
             "https://roosterteeth.com/api/v1/shows/55")
         show = models.Show(show_data.json())
         assert show.cover_picture is None