Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
geomag-algorithms
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ghsc
National Geomagnetism Program
geomag-algorithms
Commits
a74140ef
Commit
a74140ef
authored
5 years ago
by
Jeremy M Fee
Browse files
Options
Downloads
Patches
Plain Diff
Fix test names, add test for 3 character code
parent
facc59ec
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/edge_test/MiniSeedFactory_test.py
+10
-8
10 additions, 8 deletions
test/edge_test/MiniSeedFactory_test.py
with
10 additions
and
8 deletions
test/edge_test/MiniSeedFactory_test.py
+
10
−
8
View file @
a74140ef
"""
Tests for
Edge
Factory.py
"""
"""
Tests for
MiniSeed
Factory.py
"""
from
obspy.core
import
Stream
,
Trace
,
UTCDateTime
from
obspy.core
import
Stream
,
Trace
,
UTCDateTime
from
geomagio.edge
import
MiniSeedFactory
from
geomagio.edge
import
MiniSeedFactory
...
@@ -6,7 +6,7 @@ from nose.tools import assert_equals
...
@@ -6,7 +6,7 @@ from nose.tools import assert_equals
def
test__get_edge_network
():
def
test__get_edge_network
():
"""
edge_test.
Edge
Factory_test.test__get_edge_network()
"""
edge_test.
MiniSeed
Factory_test.test__get_edge_network()
"""
"""
# _get_edge_network should always return NT for use by USGS geomag
# _get_edge_network should always return NT for use by USGS geomag
assert_equals
(
assert_equals
(
...
@@ -15,7 +15,7 @@ def test__get_edge_network():
...
@@ -15,7 +15,7 @@ def test__get_edge_network():
def
test__get_edge_station
():
def
test__get_edge_station
():
"""
edge_test.
Edge
Factory_test.test__get_edge_station()
"""
edge_test.
MiniSeed
Factory_test.test__get_edge_station()
"""
"""
# _get_edge_station will return the observatory code passed in.
# _get_edge_station will return the observatory code passed in.
assert_equals
(
assert_equals
(
...
@@ -24,7 +24,7 @@ def test__get_edge_station():
...
@@ -24,7 +24,7 @@ def test__get_edge_station():
def
test__get_edge_channel
():
def
test__get_edge_channel
():
"""
edge_test.
Edge
Factory_test.test__get_edge_channel()
"""
edge_test.
MiniSeed
Factory_test.test__get_edge_channel()
"""
"""
# Call private function _get_edge_channel, make certain
# Call private function _get_edge_channel, make certain
# it gets back the appropriate 2 character code.
# it gets back the appropriate 2 character code.
...
@@ -36,6 +36,8 @@ def test__get_edge_channel():
...
@@ -36,6 +36,8 @@ def test__get_edge_channel():
'
UFF
'
)
'
UFF
'
)
assert_equals
(
MiniSeedFactory
().
_get_edge_channel
(
''
,
'
H
'
,
''
,
'
minute
'
),
assert_equals
(
MiniSeedFactory
().
_get_edge_channel
(
''
,
'
H
'
,
''
,
'
minute
'
),
'
UFH
'
)
'
UFH
'
)
assert_equals
(
MiniSeedFactory
().
_get_edge_channel
(
''
,
'
BEU
'
,
''
,
'
minute
'
),
'
BEU
'
)
assert_equals
(
assert_equals
(
MiniSeedFactory
().
_get_edge_channel
(
''
,
'
DIST
'
,
''
,
'
minute
'
),
MiniSeedFactory
().
_get_edge_channel
(
''
,
'
DIST
'
,
''
,
'
minute
'
),
'
UX4
'
)
'
UX4
'
)
...
@@ -48,7 +50,7 @@ def test__get_edge_channel():
...
@@ -48,7 +50,7 @@ def test__get_edge_channel():
def
test__get_edge_location
():
def
test__get_edge_location
():
"""
edge_test.
Edge
Factory_test.test__get_edge_location()
"""
edge_test.
MiniSeed
Factory_test.test__get_edge_location()
"""
"""
# Call _get_edge_location, make certain it returns the correct edge
# Call _get_edge_location, make certain it returns the correct edge
# location code.
# location code.
...
@@ -61,7 +63,7 @@ def test__get_edge_location():
...
@@ -61,7 +63,7 @@ def test__get_edge_location():
def
test__get_interval_code
():
def
test__get_interval_code
():
"""
edge_test.
Edge
Factory_test.test__get_interval_code()
"""
edge_test.
MiniSeed
Factory_test.test__get_interval_code()
"""
"""
assert_equals
(
MiniSeedFactory
().
_get_interval_code
(
'
day
'
),
'
P
'
)
assert_equals
(
MiniSeedFactory
().
_get_interval_code
(
'
day
'
),
'
P
'
)
assert_equals
(
MiniSeedFactory
().
_get_interval_code
(
'
hour
'
),
'
R
'
)
assert_equals
(
MiniSeedFactory
().
_get_interval_code
(
'
hour
'
),
'
R
'
)
...
@@ -71,7 +73,7 @@ def test__get_interval_code():
...
@@ -71,7 +73,7 @@ def test__get_interval_code():
def
test__set_metadata
():
def
test__set_metadata
():
"""
edge_test.
Edge
Factory_test.test__set_metadata()
"""
edge_test.
MiniSeed
Factory_test.test__set_metadata()
"""
"""
# Call _set_metadata with 2 traces, and make certain the stats get
# Call _set_metadata with 2 traces, and make certain the stats get
# set for both traces.
# set for both traces.
...
@@ -85,7 +87,7 @@ def test__set_metadata():
...
@@ -85,7 +87,7 @@ def test__set_metadata():
# def test_get_timeseries():
# def test_get_timeseries():
def
dont_get_timeseries
():
def
dont_get_timeseries
():
"""
edge_test.
Edge
Factory_test.test_get_timeseries()
"""
"""
edge_test.
MiniSeed
Factory_test.test_get_timeseries()
"""
# Call get_timeseries, and test stats for comfirmation that it came back.
# Call get_timeseries, and test stats for comfirmation that it came back.
# TODO, need to pass in host and port from a config file, or manually
# TODO, need to pass in host and port from a config file, or manually
# change for a single test.
# change for a single test.
...
...
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