Beispiel #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()
Beispiel #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()
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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()
Beispiel #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()
Beispiel #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)