Skip to content
Snippets Groups Projects
Commit df1edfeb authored by Sam Kagan's avatar Sam Kagan
Browse files

Removed test/__init__.py, renamed fixture for casa_envoy

parent a40f6c38
No related branches found
No related tags found
2 merge requests!1706merge 2.8.4 to main,!1657Got EVLA CMS restores working via casa_envoy, using casa_restorepipescript.py when it exists
# Copyright (C) 2023 Associated Universities, Inc. Washington DC, USA.
#
# This file is part of NRAO Workspaces.
#
# Workspaces is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Workspaces is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Workspaces. If not, see <https://www.gnu.org/licenses/>.
#
......@@ -47,7 +47,7 @@ def general(cal_settings) -> GeneralFoundation:
@pytest.fixture
def foundation(cal_settings) -> RestoreFoundation:
def restore(cal_settings) -> RestoreFoundation:
return RestoreFoundation(parameters=cal_settings, metadata=test_restore_metadata)
......@@ -89,17 +89,17 @@ class TestRestoreFoundation:
"""
@patch("os.chdir")
def test_restore_data_foundation(self, mock_chdir, foundation):
def test_restore_data_foundation(self, mock_chdir, restore):
with patch("casa_envoy.foundation.RestoreFoundation.extract_cal") as extract:
with patch("casa_envoy.foundation.set_permissions") as permissions:
foundation.data_foundation()
restore.data_foundation()
assert mock_chdir.call_count == 1
@patch("pathlib.Path.exists", return_value=True)
@patch("tarfile.open")
@patch("shutil.copytree")
def test_extract_cal(self, mock_copytree, mock_tar, mock_path, foundation):
foundation.extract_cal()
def test_extract_cal(self, mock_copytree, mock_tar, mock_path, restore):
restore.extract_cal()
assert mock_tar.call_count == 1
assert mock_copytree.call_count == 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment