Skip to content
Snippets Groups Projects
Commit 0b367316 authored by Daniel Nemergut's avatar Daniel Nemergut
Browse files

Unit test skeleton

parent 67eb76c5
No related branches found
No related tags found
2 merge requests!1706merge 2.8.4 to main,!1670WS-1405 CASA matrix service
#
# Copyright (C) 2021 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/>.
""" Tests for CASA Matrix Service """
# pylint: disable=C0103, E0401, R0201, W0621
import http
import json
import pytest
from pycapo import CapoConfig
from typing import Dict
from unittest.mock import MagicMock, patch
from workspaces.system.services.casa_matrix_service import CasaMatrixService
from workspaces.capability.schema import CasaMatrixCapability, CasaMatrixCasaVersion
settings = CapoConfig().settings("edu.nrao.archive.workflow.config.CasaVersions")
DEFAULT_CASA = settings["homeForDownloads"]
VLA_DEFAULT_CASA = settings["homeForVlaRestore"]
ALMA_DEFAULT_CASA = settings["homeForAlmaRestore"]
VUDI_DEFAULT_CASA = settings["homeForVlaUserDrivenImaging"]
AUDI_DEFAULT_CASA = settings["homeForAlmaUserDrivenImaging"]
ROUTER_PATCH = "workspaces.system.services.casa_matrix_service.Router"
@pytest.fixture(scope="module")
def fake_casa_version(casa_version: str, capability: str, telescope: str) -> json:
return json.dumps({
"casa_version": casa_version,
'capability': capability,
'telescope': telescope
})
class TestCasaMatrixService:
"""Test class for CasaMatrixService"""
def test_vla_default_version(self, fake_casa_version: Dict[str, str, str]):
assert True
def test_alma_default_version(self):
assert True
def test_vla_stored_version(self):
assert True
def test_alma_stored_version(self):
assert True
def test_vla_invalid_version(self):
assert True
def test_alma_invalid_version(self):
assert True
def test_vla_recipe(self):
assert True
def test_alma_recipe(self):
assert True
def test_get_version(self, fake_version_info: Dict[str, str, str]):
assert True
def test_get_versions(self, fake_version_info: Dict[str, str, str]):
assert True
def test_add_version(self, fake_version_info: Dict[str, str, str]):
assert True
def test_update_version(self, fake_version_info: Dict[str, str, str]):
assert True
def test_delete_version(self, fake_version_info: Dict[str, str, str]):
assert True
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