Exemple #1
0
    def test_feed_unicode_episode(self):
        config = {
            'submitters': self.submitters,
        }
        feed = {
            'submitter': u'sage-koi',
            'search': u'CØDE:BREAKER',
        }
        search_result = [self.code_breaker]
        expected = [self.code_breaker]

        with patch('animesubs.nyaa.search', return_value=search_result) as mocked:
            result = nyaa.fetch_feed(feed, config)

            self.assertEquals(result, expected)
            mocked.assert_called_once_with(3, u'CØDE:BREAKER')
Exemple #2
0
    def test_feed_two_episodes(self):
        config = {
            'submitters': self.submitters
        }
        feed = {
            'submitter': 'Commie',
            'search': 'various',
        }
        search_result = [self.sword_art_online, self.code_breaker]
        expected = [self.sword_art_online, self.code_breaker]

        with patch('animesubs.nyaa.search', return_value=search_result) as mocked:
            result = nyaa.fetch_feed(feed, config)

            self.assertEquals(result, expected)
            mocked.assert_called_once_with(1, u'various')
Exemple #3
0
    def test_feed_one_episode(self):
        config = {
            'submitters': self.submitters,
        }
        feed = {
            'submitter': 'Commie',
            'search': 'Sword Art Online',
        }
        search_result = [self.sword_art_online]
        expected = [self.sword_art_online]

        with patch('animesubs.nyaa.search', return_value=search_result) as mocked:
            result = nyaa.fetch_feed(feed, config)

            self.assertEquals(result, expected)
            mocked.assert_called_once_with(1, 'Sword Art Online')