Exemple #1
0
 def test_schema_negative_wrong_credential(self, schemaregistry_endpoint,
                                           schemaregistry_group, **kwargs):
     credential = ClientSecretCredential(tenant_id="fake",
                                         client_id="fake",
                                         client_secret="fake")
     client = SchemaRegistryClient(endpoint=schemaregistry_endpoint,
                                   credential=credential)
     schema_name = self.get_resource_name('test-schema-negative')
     schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}"""
     serialization_type = "Avro"
     with pytest.raises(ClientAuthenticationError):
         client.register_schema(schemaregistry_group, schema_name,
                                serialization_type, schema_str)
 def test_schema_negative_wrong_credential(self, **kwargs):
     schemaregistry_fully_qualified_namespace = kwargs.pop(
         "schemaregistry_fully_qualified_namespace")
     print(schemaregistry_fully_qualified_namespace)
     schemaregistry_group = kwargs.pop("schemaregistry_group")
     credential = ClientSecretCredential(tenant_id="fake",
                                         client_id="fake",
                                         client_secret="fake")
     client = SchemaRegistryClient(
         fully_qualified_namespace=schemaregistry_fully_qualified_namespace,
         credential=credential)
     name = self.get_resource_name('test-schema-negative')
     schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}"""
     format = "Avro"
     with pytest.raises(ClientAuthenticationError):
         client.register_schema(schemaregistry_group, name, schema_str,
                                format)