diff --git a/geomagio/api/ws/DataApiQuery.py b/geomagio/api/ws/DataApiQuery.py index 06fff9810b2099ba749a19625b8c60157790a6ce..3d7a71c4bc7aa577656ed034df3ed228729d6eaf 100644 --- a/geomagio/api/ws/DataApiQuery.py +++ b/geomagio/api/ws/DataApiQuery.py @@ -70,9 +70,9 @@ class DataApiQuery(BaseModel): endtime: Optional[CustomUTCDateTimeType] = None elements: List[str] = DEFAULT_ELEMENTS sampling_period: SamplingPeriod = SamplingPeriod.MINUTE - data_type: DataType = DataType.VARIATION - format: OutputFormat = OutputFormat.IAGA2002 - data_host: DataHost = DataHost.DEFAULT + data_type: Union[DataType, str] = DataType.VARIATION + format: Union[OutputFormat, str] = OutputFormat.IAGA2002 + data_host: Union[DataHost, str] = DataHost.DEFAULT @field_validator("starttime", mode="before") def validate_starttime( diff --git a/test/DataApiQuery_test.py b/test/DataApiQuery_test.py index 4434af7d15411e38502c56acfcd4d9fc0e4de318..117f1758c1be5f4d9668dc25208ec8fcee5a3596 100644 --- a/test/DataApiQuery_test.py +++ b/test/DataApiQuery_test.py @@ -65,9 +65,9 @@ def test_DataApiQuery_valid(): assert_equal(query.endtime, UTCDateTime("2024-09-01T01:00:01")) assert_equal(query.elements, ["F"]) assert_equal(query.sampling_period, SamplingPeriod.SECOND) - assert_equal(query.data_type, DataType.ADJUSTED) - assert_equal(query.format, OutputFormat.JSON) - assert_equal(query.data_host, DataHost.CWBPUB) + assert_equal(query.data_type, "adjusted") + assert_equal(query.format, "json") + assert_equal(query.data_host, "cwbpub.cr.usgs.gov") def test_DataApiQuery_no_id(): diff --git a/test/FilterApiQuery_test.py b/test/FilterApiQuery_test.py index b6a4dc04c5b023d0d303394babfeaa55b0bc2011..6393297ace548bcad18126a2c3e4d4628ae28cf4 100644 --- a/test/FilterApiQuery_test.py +++ b/test/FilterApiQuery_test.py @@ -48,9 +48,9 @@ def test_FilterApiQuery_valid(): assert_equal(query.elements, ["Z"]) assert_equal(query.input_sampling_period, SamplingPeriod.MINUTE) assert_equal(query.sampling_period, SamplingPeriod.HOUR) - assert_equal(query.data_type, DataType.ADJUSTED) - assert_equal(query.format, OutputFormat.JSON) - assert_equal(query.data_host, DataHost.CWBPUB) + assert_equal(query.data_type, "adjusted") + assert_equal(query.format, "json") + assert_equal(query.data_host, "cwbpub.cr.usgs.gov") def test_FilterApiQuery_no_id(): diff --git a/test/api_test/ws_test/data_test.py b/test/api_test/ws_test/data_test.py index 96fba2f0d3bc02b2eb4428ee2295969286593db0..9a3da337112643e66030b3d0ac3406af19741419 100644 --- a/test/api_test/ws_test/data_test.py +++ b/test/api_test/ws_test/data_test.py @@ -36,8 +36,8 @@ def test_get_data_query(test_client): assert_equal(query.endtime, UTCDateTime("2020-09-02T00:00:00.999")) assert_equal(query.elements, ["X", "Y", "Z", "F"]) assert_equal(query.sampling_period, SamplingPeriod.MINUTE) - assert_equal(query.format, OutputFormat.IAGA2002) - assert_equal(query.data_type, DataType.VARIATION) + assert_equal(query.format, "iaga2002") + assert_equal(query.data_type, "variation") def test_get_data_query_no_starttime(test_client): diff --git a/test/api_test/ws_test/filter_test.py b/test/api_test/ws_test/filter_test.py index 470e8474364bdf88a3fde8313ae3cf5ac13e344c..aa0a4d8f05ce533b2bd787e353c07a32a7fea065 100644 --- a/test/api_test/ws_test/filter_test.py +++ b/test/api_test/ws_test/filter_test.py @@ -31,8 +31,8 @@ def test_get_filter_data_query(test_client): assert_equal(query.starttime, UTCDateTime("2020-09-01T00:00:01")) assert_equal(query.endtime, UTCDateTime("2020-09-02T00:00:00.999")) assert_equal(query.elements, ["X", "Y", "Z", "F"]) - assert_equal(query.format, OutputFormat.IAGA2002) - assert_equal(query.data_type, DataType.VARIATION) + assert_equal(query.format, "iaga2002") + assert_equal(query.data_type, "variation") assert_equal(query.input_sampling_period, SamplingPeriod.MINUTE) assert_equal(query.output_sampling_period, SamplingPeriod.HOUR)