示例#1
0
    def test_can_pass_dir(self):
        self.assertFalse(self.exists("mkv_sub/a_movie.sub"), "a_movie.sub should not exist yet")
        self.assertTrue(self.exists("mkv_sub/some_subs.sub"), "some_subs.sub should exist")
        self.assertTrue(self.exists("subdir/avi_srt/shtein.srt"), "file above cwd should exist prior to call")
        self.assertFalse(self.exists("subdir/avi_srt/shtein.avi"), "movie above cwd shouldn't match subtitle file")
        submatcher.submatcher("mkv_sub")
        self.assertTrue(self.exists("mkv_sub/a_movie.sub"), "a_movie.sub should exist")
        self.assertFalse(self.exists("mkv_sub/some_subs.sub"), "some_subs.sub should have been renamed")

        self.assertTrue(self.exists("subdir/avi_srt/shtein.srt"), "should not have touched files above cwd")
示例#2
0
    def test_defaults_to_current_working_dir(self):
        os.chdir("mkv_sub")
        self.assertFalse(self.exists("a_movie.sub"), "a_movie.sub should not exist yet")
        self.assertTrue(self.exists("some_subs.sub"), "some_subs.sub should exist")
        self.assertTrue(self.exists("../subdir/avi_srt/shtein.srt"), "file above cwd should exist prior to call")
        self.assertFalse(self.exists("../subdir/avi_srt/shtein.avi"), "movie above cwd shouldn't match subtitle file")
        submatcher.submatcher()
        self.assertTrue(self.exists("a_movie.sub"), "a_movie.sub should exist")
        self.assertFalse(self.exists("some_subs.sub"), "some_subs.sub should have been renamed")

        self.assertTrue(self.exists("../subdir/avi_srt/shtein.srt"), "should not have touched files above cwd")
示例#3
0
 def test_dryrun(self):
     submatcher.dryrun = True
     self.assertTrue(self.exists("mkv_sub/some_subs.sub"), "some_subs.sub should exist")
     self.assertTrue(self.exists("mkv_sub/a_movie.mkv"), "there should be a matching movie, ready to be matched against")
     submatcher.submatcher("mkv_sub")
     self.assertTrue(self.exists("mkv_sub/some_subs.sub"), "some_subs.sub should still exist")
示例#4
0
 def test_is_recursive(self):
     self.assertFalse(self.exists("subdir/avi_srt/leven.srt"), "leven.srt should not exist yet")
     self.assertTrue(self.exists("subdir/avi_srt/shtein.srt"), "shtein.srt should exist")
     submatcher.submatcher(self.tempdir)
     self.assertTrue(self.exists("subdir/avi_srt/leven.srt"), "leven.srt should exist")
     self.assertFalse(self.exists("subdir/avi_srt/shtein.srt"), "shtein.srt should have been moved")
示例#5
0
 def test_simple(self):
     self.assertFalse(self.exists("mkv_sub/a_movie.sub"), "a_movie.sub should not exist yet")
     self.assertTrue(self.exists("mkv_sub/some_subs.sub"), "some_subs.sub should exist")
     submatcher.submatcher(self.tempdir)
     self.assertTrue(self.exists("mkv_sub/a_movie.sub"), "a_movie.sub should exist")
     self.assertFalse(self.exists("mkv_sub/some_subs.sub"), "some_subs.sub should have been moved")