Esempio n. 1
0
    def test_houdini_path(self, mock_find, mock_glob):
        mock_folder_path = MagicMock(spec=str)
        mock_find.return_value = [mock_folder_path]

        mock_path1 = MagicMock(spec=str)
        mock_path2 = MagicMock(spec=str)

        mock_glob.return_value = [mock_path1, mock_path2]

        with patch.dict(os.environ, {}, clear=True):
            result = manager._find_aov_files()

        self.assertEqual(result, (mock_path1, mock_path2))

        mock_find.assert_called()

        mock_glob.assert_called_with(os.path.join(mock_folder_path, "*.json"))
Esempio n. 2
0
    def test_aov_path(self, mock_get_folders, mock_glob):
        mock_folder_path = MagicMock(spec=str)
        mock_get_folders.return_value = (mock_folder_path, )

        mock_path1 = MagicMock(spec=str)
        mock_path2 = MagicMock(spec=str)

        mock_glob.return_value = [mock_path1, mock_path2]

        with patch.dict(os.environ, {"HT_AOV_PATH": "value"}):
            result = manager._find_aov_files()

        self.assertEqual(result, (mock_path1, mock_path2))

        mock_get_folders.assert_called()

        mock_glob.assert_called_with(os.path.join(mock_folder_path, "*.json"))
Esempio n. 3
0
    def test_houdini_path(self, mocker):
        """Test finding aov files with HOUDINI_PATH."""
        mock_find = mocker.patch(
            "ht.sohohooks.aovs.manager._find_houdinipath_aov_folders")
        mock_glob = mocker.patch("ht.sohohooks.aovs.manager.glob.glob")

        mock_folder_path = mocker.MagicMock(spec=str)
        mock_find.return_value = [mock_folder_path]

        mock_path1 = mocker.MagicMock(spec=str)
        mock_path2 = mocker.MagicMock(spec=str)

        mock_glob.return_value = [mock_path1, mock_path2]

        mocker.patch.dict(os.environ, {}, clear=True)
        result = manager._find_aov_files()

        assert result == (mock_path1, mock_path2)

        mock_find.assert_called()

        mock_glob.assert_called_with(os.path.join(mock_folder_path, "*.json"))
Esempio n. 4
0
    def test_aov_path(self, mocker):
        """Test finding aov files with HT_AOV_PATH."""
        mock_glob = mocker.patch("ht.sohohooks.aovs.manager.glob.glob")
        mock_get_folders = mocker.patch(
            "ht.sohohooks.aovs.manager._get_aov_path_folders")

        mock_folder_path = mocker.MagicMock(spec=str)
        mock_get_folders.return_value = (mock_folder_path, )

        mock_path1 = mocker.MagicMock(spec=str)
        mock_path2 = mocker.MagicMock(spec=str)

        mock_glob.return_value = [mock_path1, mock_path2]

        mocker.patch.dict(os.environ, {"HT_AOV_PATH": "value"})

        result = manager._find_aov_files()

        assert result == (mock_path1, mock_path2)

        mock_get_folders.assert_called()

        mock_glob.assert_called_with(os.path.join(mock_folder_path, "*.json"))