Newer
Older
from geomagio.edge import SNCL
def test_data_type():
assert SNCL(station="BOU", channel="LFU", location="R0").data_type == "variation"
assert SNCL(station="BOU", channel="LFU", location="A0").data_type == "adjusted"
assert (
SNCL(station="BOU", channel="LFU", location="Q0").data_type
== "quasi-definitive"
)
assert SNCL(station="BOU", channel="LFU", location="D0").data_type == "definitive"
def test_element():
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
assert (
SNCL(
station="BOU",
channel="UFD",
location="R0",
).element
== "D"
)
assert (
SNCL(
station="BOU",
channel="UFU",
location="R0",
).element
== "U"
)
assert (
SNCL(
station="BOU",
channel="UFF",
location="R0",
).element
== "F"
)
assert (
SNCL(
station="BOU",
channel="UFH",
location="R0",
).element
== "H"
)
assert (
SNCL(
station="BOU",
channel="UX4",
location="R0",
).element
== "Dst4"
)
assert (
SNCL(
station="BOU",
channel="UX3",
location="R0",
).element
== "Dst3"
)
assert (
SNCL(
station="BOU",
channel="UQE",
location="R0",
).element
== "E-E"
)
assert (
SNCL(
station="BOU",
channel="UQN",
location="R0",
).element
== "E-N"
)
assert (
SNCL(
station="BOU",
channel="BEU",
location="R0",
).element
== "U_Volt"
)
assert (
SNCL(
station="BOU",
channel="BYU",
location="R0",
).element
== "U_Bin"
)
assert (
SNCL(
station="BOU",
channel="UFU",
location="R1",
).element
== "U_Sat"
)
def test_get_sncl():
"""edge_test.SNCL_test.test_get_sncl()"""
assert SNCL().get_sncl(
station="BOU", data_type="variation", interval="second", element="U"
) == SNCL(station="BOU", network="NT", channel="LFU", location="R0")
def test_interval():
"""edge_test.SNCL_test.test_interval()"""
def test_parse_sncl():
"""edge_test.SNCL_test.test_parse_sncl()"""
assert SNCL(station="BOU", channel="UFU", location="R0").parse_sncl() == {
"station": "BOU",
"network": "NT",
"data_type": "variation",
"element": "U",
"interval": "minute",
}