def get_podcast_episodes(podcast, count=5): return parser_list( PodcastEpisode, call_api('getPodcastEpisodes', { 'podcast': podcast, 'count': count, }))
def get_podcast_live(podcast, count=5): return parser_list( PodcastLive, call_api('getPodcastLive', { 'podcast': podcast, 'count': count, }))
def get_deleted(dateStart=None, dateEnd=None): params = {} if dateStart is not None: params['dateStart'] = dateStart.strftime('%y-%m-%d') if dateEnd is not None: params['dateEnd'] = dateEnd.strftime('%y-%m-%d') return parser_list(DeleteEntry, call_api('getDeleted', params))
def get_live(count=5, dateStart=None, dateEnd=None): params = {'count': count} if dateStart is not None: params['dateStart'] = dateStart.strftime('%y-%m-%d') if dateEnd is not None: params['dateEnd'] = dateEnd.strftime('%y-%m-%d') return parser_list(PodcastLive, call_api('getLive', params))
def get_live(count=5, dateStart=None, dateEnd=None): params = { 'count': count } if dateStart is not None: params['dateStart'] = dateStart.strftime('%y-%m-%d') if dateEnd is not None: params['dateEnd'] = dateEnd.strftime('%y-%m-%d') return parser_list(PodcastLive, call_api('getLive', params))
def get_podcast_episodes(podcast, count=5): return parser_list(PodcastEpisode, call_api('getPodcastEpisodes', { 'podcast': podcast, 'count': count, }))
def get_podcasts(): return parser_list(Podcast, call_api('getPodcasts'))
def test_none(self): lst = parser_list(MockCounter, None) assert isinstance(lst, list) assert len(lst) == 0
def test_no_array(self): with pytest.raises(InvalidDataError): parser_list(MockCounter, (None,))
def test_call_clazz(self): global mockCalled; mockCalled = 0 parser_list(MockCounter, [{}, {}]) assert mockCalled == 2
def get_podcast_live(podcast, count=5): return parser_list(PodcastLive, call_api('getPodcastLive', { 'podcast': podcast, 'count': count, }))
def test_no_array(self): with pytest.raises(InvalidDataError): parser_list(MockCounter, (None, ))
def test_call_clazz(self): global mockCalled mockCalled = 0 parser_list(MockCounter, [{}, {}]) assert mockCalled == 2