Esempio n. 1
0
    def test_file_invalid(self):
        self.mock_isfile.return_value = True
        with self.assertRaises(ValueError):
            mkvstrip.walk_directory("/movies/desktop.ini")

        self.assertTrue(self.mock_isfile.called)
        self.mock_isdir.assert_not_called()
Esempio n. 2
0
    def test_file_invalid(self):
        self.mock_isfile.return_value = True
        with self.assertRaises(ValueError):
            mkvstrip.walk_directory("/movies/desktop.ini")

        self.assertTrue(self.mock_isfile.called)
        self.mock_isdir.assert_not_called()
Esempio n. 3
0
 def test_dir_no_mkv(self, mock_walk):
     self.mock_isdir.return_value = True
     ret = mkvstrip.walk_directory("/movies/")
     self.assertFalse(ret)
     self.assertTrue(self.mock_isfile.called)
     self.assertTrue(self.mock_isdir.called)
     self.assertTrue(mock_walk.called)
Esempio n. 4
0
 def test_dir_no_mkv(self, mock_walk):
     self.mock_isdir.return_value = True
     ret = mkvstrip.walk_directory("/movies/")
     self.assertFalse(ret)
     self.assertTrue(self.mock_isfile.called)
     self.assertTrue(self.mock_isdir.called)
     self.assertTrue(mock_walk.called)
Esempio n. 5
0
 def test_dir(self, mock_walk):
     self.mock_isdir.return_value = True
     ret = mkvstrip.walk_directory("/movies/")
     self.assertListEqual(ret, ["/movies/movie_one.mkv", "/movies/movie_two.mkv"])
     self.assertTrue(self.mock_isfile.called)
     self.assertTrue(self.mock_isdir.called)
     self.assertTrue(mock_walk.called)
Esempio n. 6
0
 def test_dir(self, mock_walk):
     self.mock_isdir.return_value = True
     ret = mkvstrip.walk_directory("/movies/")
     self.assertListEqual(
         ret, ["/movies/movie_one.mkv", "/movies/movie_two.mkv"])
     self.assertTrue(self.mock_isfile.called)
     self.assertTrue(self.mock_isdir.called)
     self.assertTrue(mock_walk.called)
Esempio n. 7
0
    def test_not_found(self):
        with self.assertRaises(FileNotFoundError):
            mkvstrip.walk_directory("/movies/")

        self.assertTrue(self.mock_isfile.called)
        self.assertTrue(self.mock_isdir.called)
Esempio n. 8
0
 def test_file(self):
     self.mock_isfile.return_value = True
     ret = mkvstrip.walk_directory("/movies/test.mkv")
     self.assertListEqual(ret, ["/movies/test.mkv"])
     self.assertTrue(self.mock_isfile.called)
     self.mock_isdir.assert_not_called()
Esempio n. 9
0
 def test_file(self):
     self.mock_isfile.return_value = True
     ret = mkvstrip.walk_directory("/movies/test.mkv")
     self.assertListEqual(ret, ["/movies/test.mkv"])
     self.assertTrue(self.mock_isfile.called)
     self.mock_isdir.assert_not_called()
Esempio n. 10
0
    def test_not_found(self):
        with self.assertRaises(FileNotFoundError):
            mkvstrip.walk_directory("/movies/")

        self.assertTrue(self.mock_isfile.called)
        self.assertTrue(self.mock_isdir.called)