예제 #1
0
파일: tests.py 프로젝트: chenjunqiang/TPB
class TopTestCase(RemoteTestCase):
    def setUp(self):
        self.torrents = Top(self.url)

    def test_url(self):
        self.assertEqual(str(self.torrents.url),
                self.url + '/top/0')
        self.torrents.category(100)
        self.assertEqual(str(self.torrents.url),
                self.url + '/top/100')
예제 #2
0
class TopTestCase(RemoteTestCase):
    def setUp(self):
        self.torrents = Top(self.url)

    def test_url(self):
        self.assertEqual(str(self.torrents.url), self.url + '/top/0')
        self.torrents.category(100)
        self.assertEqual(str(self.torrents.url), self.url + '/top/100')

    def test_results(self):
        self.assertEqual(len(list(self.torrents.items())), 100)
예제 #3
0
파일: tests.py 프로젝트: 013/TPB
class TopTestCase(RemoteTestCase):

    def setUp(self):
        self.torrents = Top(self.url)

    def test_url(self):
        self.assertEqual(str(self.torrents.url),
                         self.url + '/top/0')
        self.torrents.category(100)
        self.assertEqual(str(self.torrents.url),
                         self.url + '/top/100')

    def test_results(self):
        self.assertEqual(len(list(self.torrents.items())), 100)
예제 #4
0
파일: tests.py 프로젝트: themylogin/TPB
 def test_top(self):
     kwargs = {'category': 100}
     a_top = self.tpb.top(**kwargs)
     b_top = Top(self.url, **kwargs)
     self.assertTrue(isinstance(a_top, Top))
     self.assertTrue(isinstance(b_top, Top))
     self.assertEqual(str(a_top.url), str(b_top.url))
예제 #5
0
파일: tests.py 프로젝트: chenjunqiang/TPB
 def setUp(self):
     self.torrents = Top(self.url)
예제 #6
0
파일: tests.py 프로젝트: themylogin/TPB
 def setUp(self):
     self.torrents = Top(self.url)
예제 #7
0
 def top(self, category=0):
     """
     Lists top Torrents on TPB optionally filtering by category.
     """
     return Top(self.base_url, category)