Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
workspaces
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ssa
workspaces
Commits
0b367316
Commit
0b367316
authored
10 months ago
by
Daniel Nemergut
Browse files
Options
Downloads
Patches
Plain Diff
Unit test skeleton
parent
67eb76c5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!1706
merge 2.8.4 to main
,
!1670
WS-1405 CASA matrix service
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
shared/workspaces/test/test_casa_matrix_service.py
+92
-0
92 additions, 0 deletions
shared/workspaces/test/test_casa_matrix_service.py
with
92 additions
and
0 deletions
shared/workspaces/test/test_casa_matrix_service.py
0 → 100644
+
92
−
0
View file @
0b367316
#
# 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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment