Exemple #1
0
 def testApp(self):
     filename = 'Les.astres.noirs.S2009E01.Les.astres.noirs.460kbps.ts'
     expected_size = 58212288
     args = ['fetch', '-f', '-q', 'MIN', 'Les astres noirs', 'S2009E01']
     a = app.App(args)
     rc = a.run()
     self.assertEquals(rc, 0)
     self.assertTrue(os.path.exists(filename))
     self.assertEquals(os.path.getsize(filename), expected_size)
Exemple #2
0
    def _testFetch(self, expected_filename, args):
        # Delete the file if it exists prior to the test.
        for file in glob.glob(expected_filename):
            os.unlink(file)

        args = ['--verbose', 'fetch', '-qMIN'] + args

        self.assertEqual(app.App(args).run(), 0)

        self.assertTrue(len(glob.glob(expected_filename)) > 0)

        # Be nice and leave no trace.
        for file in glob.glob(expected_filename):
            os.unlink(file)
Exemple #3
0
    def _testSearch(self, args):
        args = ['--verbose', 'search'] + args

        self.assertEqual(app.App(args).run(), 0)
Exemple #4
0
    def _testList(self, args):
        args = ['--verbose', 'list'] + args

        self.assertEqual(app.App(args).run(), 0)
Exemple #5
0
    def _testInfo(self, args):
        args = ['--verbose', 'info'] + args

        self.assertEqual(app.App(args).run(), 0)
Exemple #6
0
 def setUp(self):
     self._app = app.App([])