Exemplo n.º 1
0
    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'))
Exemplo n.º 2
0
    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'))
Exemplo n.º 3
0
    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)
Exemplo n.º 4
0
    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'))
Exemplo n.º 5
0
    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'))
Exemplo n.º 6
0
 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)
Exemplo n.º 7
0
 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)
Exemplo n.º 8
0
 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)