@@ -86,10 +86,90 @@ def test_message_registry_keys(self, prod_config):
86
86
"crash" ,
87
87
]
88
88
89
+ def test_TWDP_ferry_platform (self , prod_config ):
90
+ ferry_config = prod_config ["observations" ]["ferry data" ]["ferries" ]["TWDP" ]
91
+ assert ferry_config ["route name" ] == "Tsawwassen - Duke Point"
92
+ expected = "Mobile Platforms, British Columbia Ferries, Tsawwassen - Duke Point"
93
+ assert ferry_config ["ONC station description" ] == expected
94
+
95
+ def test_TWDP_location (self , prod_config ):
96
+ location_config = prod_config ["observations" ]["ferry data" ]["ferries" ]["TWDP" ][
97
+ "location"
98
+ ]
99
+ assert location_config ["stations" ] == ["TWDP.N1" , "TWDP.N2" ]
100
+ assert location_config ["device category" ] == "NAV"
101
+ assert location_config ["sensors" ] == ["longitude" , "latitude" ]
102
+ assert location_config ["terminals" ] == ["Tsawwassen" , "Duke Pt." ]
103
+
104
+ def test_TWDP_devices (self , prod_config ):
105
+ devices_config = prod_config ["observations" ]["ferry data" ]["ferries" ]["TWDP" ][
106
+ "devices"
107
+ ]
108
+ expected = {
109
+ "TSG" : {
110
+ "sensors" : {
111
+ "temperature" : "temperature" ,
112
+ "conductivity" : "conductivity" ,
113
+ "salinity" : "salinity" ,
114
+ },
115
+ },
116
+ "OXYSENSOR" : {
117
+ "sensors" : {
118
+ "o2_saturation" : "oxygen_saturation" ,
119
+ "o2_concentration_corrected" : "oxygen_corrected" ,
120
+ "o2_temperature" : "temperature" ,
121
+ },
122
+ },
123
+ "TURBCHLFL" : {
124
+ "sensors" : {
125
+ "cdom_fluorescence" : "cdom_fluorescence" ,
126
+ "chlorophyll" : "chlorophyll" ,
127
+ "turbidity" : "turbidity" ,
128
+ },
129
+ },
130
+ "CO2SENSOR" : {
131
+ "sensors" : {
132
+ "co2_partial_pressure" : "partial_pressure" ,
133
+ "co2_concentration_linearized" : "co2" ,
134
+ },
135
+ },
136
+ "TEMPHUMID" : {
137
+ "sensors" : {
138
+ "air_temperature" : "air_temperature" ,
139
+ "relative_humidity" : "rel_humidity" ,
140
+ },
141
+ },
142
+ "BARPRESS" : {
143
+ "sensors" : {
144
+ "barometric_pressure" : "barometric_pressure" ,
145
+ },
146
+ },
147
+ "PYRANOMETER" : {
148
+ "sensors" : {
149
+ "solar_radiation" : "solar_radiation" ,
150
+ },
151
+ },
152
+ "PYRGEOMETER" : {
153
+ "sensors" : {
154
+ "longwave_radiation" : "downward_radiation" ,
155
+ },
156
+ },
157
+ }
158
+ assert devices_config == expected
159
+
89
160
def test_lon_lat_ji_map_path (self , prod_config ):
90
161
nemo_ji_map = prod_config ["observations" ]["lon/lat to NEMO ji map" ]
91
162
assert nemo_ji_map == "/SalishSeaCast/grid/grid_from_lat_lon_mask999.nc"
92
163
164
+ def test_TWDP_file_path_template (self , prod_config ):
165
+ file_path_tmpl = prod_config ["observations" ]["ferry data" ]["ferries" ]["TWDP" ][
166
+ "filepath template"
167
+ ]
168
+ assert (
169
+ file_path_tmpl
170
+ == "{ferry_platform}/{ferry_platform}_TSG_O2_TURBCHLFL_CO2_METEO_1m_{yyyymmdd}.nc"
171
+ )
172
+
93
173
def test_dest_dir (self , prod_config ):
94
174
ferry_data_config = prod_config ["observations" ]["ferry data" ]
95
175
assert ferry_data_config ["dest dir" ] == "/results/observations/ONC/ferries/"
@@ -103,7 +183,7 @@ def test_success(self, ferry_platform, caplog):
103
183
parsed_args = SimpleNamespace (
104
184
ferry_platform = ferry_platform , data_date = arrow .get ("2016-09-09" )
105
185
)
106
- caplog .set_level (logging .INFO )
186
+ caplog .set_level (logging .DEBUG )
107
187
108
188
msg_type = get_onc_ferry .success (parsed_args )
109
189
@@ -121,7 +201,7 @@ def test_failure(self, ferry_platform, caplog):
121
201
parsed_args = SimpleNamespace (
122
202
ferry_platform = ferry_platform , data_date = arrow .get ("2016-09-09" )
123
203
)
124
- caplog .set_level (logging .CRITICAL )
204
+ caplog .set_level (logging .DEBUG )
125
205
126
206
msg_type = get_onc_ferry .failure (parsed_args )
127
207
0 commit comments