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)
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)
def _testSearch(self, args): args = ['--verbose', 'search'] + args self.assertEqual(app.App(args).run(), 0)
def _testList(self, args): args = ['--verbose', 'list'] + args self.assertEqual(app.App(args).run(), 0)
def _testInfo(self, args): args = ['--verbose', 'info'] + args self.assertEqual(app.App(args).run(), 0)
def setUp(self): self._app = app.App([])