def test_force(self): opts = getOptions([self.WORK_DIR, '-f']) s = Scenery(opts) s.run() postRunState = self.getTargetFiles() self.assertItemsEqual(postRunState, self.generateExpectedFiles('expected-force.txt'))
def test_episode_zeroes(self): opts = getOptions([self.WORK_DIR, '-e']) s = Scenery(opts) s.run() postRunState = self.getTargetFiles() self.assertItemsEqual( postRunState, self.generateExpectedFiles('expected-episode-zeroes.txt'))
def test_dry_run(self): preRunState = self.getTargetFiles() opts = getOptions([self.WORK_DIR, '-d']) s = Scenery(opts) s.run() # Confirm that no files have changed during the run postRunState = self.getTargetFiles() self.assertItemsEqual(preRunState, postRunState)
def test_pattern_subfolders(self): opts = getOptions([self.WORK_DIR, '-p', '%a/Season %s/%s.%n %t', '-e']) s = Scenery(opts) s.run() postRunState = self.getTargetFiles() self.assertItemsEqual( postRunState, self.generateExpectedFiles('expected-pattern-subfolders.txt'))
def test_single_file(self): opts = getOptions( [os.path.join(self.WORK_DIR, 'The.Simpsons.01x01.VHS.avi')]) s = Scenery(opts) s.run() postRunState = self.getTargetFiles() self.assertItemsEqual( postRunState, self.generateExpectedFiles('expected-single-file.txt'))
def test_defaults(self): opts = getOptions(['/dl']) self.assertEquals(opts.path, '/dl') self.assertEquals(opts.pattern, '%a S%sE%n %t') self.assertFalse(opts.zeroesSeason) self.assertFalse(opts.zeroesEpisodes) self.assertFalse(opts.overwrite) self.assertFalse(opts.dryRun) self.assertFalse(opts.verbose) self.assertFalse(opts.force)
def test_short_syntax(self): opts = getOptions( ['/dl', '-p', '%s.%n %t', '-s', '-e', '-o', '-d', '-v', '-f']) self.assertEquals(opts.path, '/dl') self.assertEquals(opts.pattern, '%s.%n %t') self.assertTrue(opts.zeroesSeason) self.assertTrue(opts.zeroesEpisodes) self.assertTrue(opts.overwrite) self.assertTrue(opts.dryRun) self.assertTrue(opts.verbose) self.assertTrue(opts.force)
def test_long_syntax(self): opts = getOptions([ '/dl', '--pattern', '%s.%n %t', '--season-zeroes', '--episode-zeroes', '--overwrite', '--dry-run', '--verbose', '--force' ]) self.assertEquals(opts.path, '/dl') self.assertEquals(opts.pattern, '%s.%n %t') self.assertTrue(opts.zeroesSeason) self.assertTrue(opts.zeroesEpisodes) self.assertTrue(opts.overwrite) self.assertTrue(opts.dryRun) self.assertTrue(opts.verbose) self.assertTrue(opts.force)