def _assert_properties_default(self, prop): self.assertIsNotNone(prop) self._assert_logging_equal(prop['analytics_logging'], AnalyticsLogging()) self._assert_metrics_equal(prop['hour_metrics'], Metrics()) self._assert_metrics_equal(prop['minute_metrics'], Metrics()) self._assert_cors_equal(prop['cors'], list())
async def test_datalake_service_properties(self, datalake_storage_account_name, datalake_storage_account_key): self._setUp(datalake_storage_account_name, datalake_storage_account_key) # Act await self.dsc.set_service_properties( analytics_logging=AnalyticsLogging(), hour_metrics=Metrics(), minute_metrics=Metrics(), cors=list(), target_version='2014-02-14' ) # Assert props = await self.dsc.get_service_properties() self._assert_properties_default(props) self.assertEqual('2014-02-14', props['target_version'])
async def test_set_minute_metrics(self, datalake_storage_account_name, datalake_storage_account_key): self._setUp(datalake_storage_account_name, datalake_storage_account_key) minute_metrics = Metrics( enabled=True, include_apis=True, retention_policy=RetentionPolicy(enabled=True, days=5)) # Act await self.dsc.set_service_properties(minute_metrics=minute_metrics) # Assert received_props = await self.dsc.get_service_properties() self._assert_metrics_equal(received_props['minute_metrics'], minute_metrics)
def test_set_hour_metrics(self, datalake_storage_account_name, datalake_storage_account_key): self._setUp(datalake_storage_account_name, datalake_storage_account_key) hour_metrics = Metrics(include_apis=False, enabled=True, retention_policy=RetentionPolicy(enabled=True, days=5)) # Act self.dsc.set_service_properties(hour_metrics=hour_metrics) # Assert received_props = self.dsc.get_service_properties() self._assert_metrics_equal(received_props['hour_metrics'], hour_metrics)