def test_delete_container_default(self, mock_cosmos): hook = AzureCosmosDBHook( azure_cosmos_conn_id='azure_cosmos_test_key_id') hook.delete_collection(self.test_collection_name) expected_calls = [ mock.call().DeleteContainer( 'dbs/test_database_default/colls/test_collection_name') ] mock_cosmos.assert_any_call(self.test_end_point, {'masterKey': self.test_master_key}) mock_cosmos.assert_has_calls(expected_calls)
def test_delete_container_exception(self, mock_cosmos): hook = AzureCosmosDBHook( azure_cosmos_conn_id='azure_cosmos_test_key_id') with pytest.raises(AirflowException): hook.delete_collection(None)