test_azure_cosmos_6.py 501 B

12345678
  1. def test_create_container(self, mock_cosmos):
  2. hook = AzureCosmosDBHook(azure_cosmos_conn_id='azure_cosmos_test_key_id')
  3. hook.create_collection(self.test_collection_name, self.test_database_name)
  4. expected_calls = [
  5. mock.call().get_database_client('test_database_name').create_container('test_collection_name')
  6. ]
  7. mock_cosmos.assert_any_call(self.test_end_point, {'masterKey': self.test_master_key})
  8. mock_cosmos.assert_has_calls(expected_calls)