-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtest_nexrad3_attr.py
More file actions
32 lines (24 loc) · 1.01 KB
/
test_nexrad3_attr.py
File metadata and controls
32 lines (24 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""Test nexrad3_attr."""
import pytest
from pywwa.testing import get_example_filepath
from pywwa.workflows import nexrad3_attr
@pytest.mark.parametrize("database", ["mesosite"])
def test_load_station_table(cursor):
"""Test loading of the station table."""
nexrad3_attr.load_station_table(cursor)
@pytest.mark.parametrize("database", ["radar"])
def test_process(cursor):
"""Test the processing of a level III file."""
with open(get_example_filepath("NCR_20121127_1413"), "rb") as fh:
ctx = nexrad3_attr.process(fh)
assert ctx["nexrad"] == "JAX"
processed = nexrad3_attr.really_process(cursor, ctx)
assert processed == 3
@pytest.mark.parametrize("database", ["radar"])
def test_210910_badvil(cursor):
"""Test that a missing VIL does not cause issues."""
with open(get_example_filepath("NCR_20210911_0023"), "rb") as fh:
ctx = nexrad3_attr.process_data(fh.read())
assert ctx["nexrad"] == "LAS"
processed = nexrad3_attr.really_process(cursor, ctx)
assert processed == 2