Exemple #1
0
 def test_getPosters_When_not_struck_out_and_delegate_returns_posters_Then_return_posters(self):
     # Setup
     provider = OneStrikeAndYoureOutFanartProvider(self.platform, self.delegate, self.nextProvider)
     when(self.delegate).getPosters(any()).thenReturn(['blah.png'])
     
     # Test
     posters = provider.getPosters(self.program)
     
     # Verify
     self.assertEqual('blah.png', posters[0])
     self.assertNotIn(self.program.title(), provider.struckOut.values())
     verifyZeroInteractions(self.nextProvider)
Exemple #2
0
 def test_getPosters_When_not_struck_out_and_delegate_returns_posters_Then_return_posters(self):
     # Setup
     provider = OneStrikeAndYoureOutFanartProvider(self.platform, self.delegate, self.nextProvider)
     when(self.delegate).getPosters(any()).thenReturn(['blah.png'])
     
     # Test
     posters = provider.getPosters(self.program)
     
     # Verify
     self.assertEqual('blah.png', posters[0])
     self.assertNotIn(self.program.title(), provider.struckOut.values())
     verifyZeroInteractions(self.nextProvider)
Exemple #3
0
 def test_getPosters_When_not_struck_out_and_delegate_returns_empty_list_Then_strike_out_and_return_nextProviders_result(self):
     # Setup
     provider = OneStrikeAndYoureOutFanartProvider(self.platform, self.delegate, self.nextProvider)
     key = provider.createKey('getPosters', self.program)
     when(self.delegate).getPosters(any()).thenReturn([])
     when(self.nextProvider).getPosters(any()).thenReturn(['blah.png'])
     
     # Test
     posters = provider.getPosters(self.program)
     
     # Verify
     self.assertEqual('blah.png', posters[0])
     self.assertIn(self.program.title(), provider.struckOut[key].values())
Exemple #4
0
 def test_getPosters_When_not_struck_out_and_delegate_returns_empty_list_Then_strike_out_and_return_nextProviders_result(self):
     # Setup
     provider = OneStrikeAndYoureOutFanartProvider(self.platform, self.delegate, self.nextProvider)
     key = provider.createKey('getPosters', self.program)
     when(self.delegate).getPosters(any()).thenReturn([])
     when(self.nextProvider).getPosters(any()).thenReturn(['blah.png'])
     
     # Test
     posters = provider.getPosters(self.program)
     
     # Verify
     self.assertEqual('blah.png', posters[0])
     self.assertIn(self.program.title(), provider.struckOut[key].values())