Beispiel #1
0
    def test_discover(self, connector_config, docker_runner: ConnectorRunner):
        """Verify that discover produce correct schema."""
        output = docker_runner.call_discover(config=connector_config)
        catalog_messages = filter_output(output, Type.CATALOG)

        assert len(catalog_messages) == 1, "Catalog message should be emitted exactly once"
        assert catalog_messages[0].catalog, "Message should have catalog"
        assert catalog_messages[0].catalog.streams, "Catalog should contain streams"
Beispiel #2
0
    def test_discover(self, connector_config, docker_runner: ConnectorRunner):
        output = docker_runner.call_discover(config=connector_config)
        catalog_messages = [
            message for message in output if message.type == Type.CATALOG
        ]

        assert len(catalog_messages
                   ) == 1, "Catalog message should be emitted exactly once"
Beispiel #3
0
    def test_discover(self, connector_config, catalog, docker_runner: ConnectorRunner):
        output = docker_runner.call_discover(config=connector_config)
        catalog_messages = [message for message in output if message.type == Type.CATALOG]

        assert len(catalog_messages) == 1, "Catalog message should be emitted exactly once"
        if catalog:
            for stream1, stream2 in zip(catalog_messages[0].catalog.streams, catalog.streams):
                assert stream1.json_schema == stream2.json_schema, f"Streams: {stream1.name} vs {stream2.name}, stream schemas should match"
                stream1.json_schema = None
                stream2.json_schema = None
                assert stream1.dict() == stream2.dict(), f"Streams {stream1.name} and {stream2.name}, stream configs should match"
Beispiel #4
0
def catalog_schemas_fixture(connector_config, docker_runner: ConnectorRunner,
                            cached_schemas) -> MutableMapping[str, Any]:
    """JSON schemas for each stream"""
    if not cached_schemas:
        output = docker_runner.call_discover(config=connector_config)
        catalogs = [
            message.catalog for message in output
            if message.type == Type.CATALOG
        ]
        for stream in catalogs[-1].streams:
            cached_schemas[stream.name] = stream.json_schema

    return cached_schemas
Beispiel #5
0
    def test_discover(self, connector_config, docker_runner: ConnectorRunner):
        output = docker_runner.call_discover(config=connector_config)
        catalog_messages = filter_output(output, Type.CATALOG)

        assert len(catalog_messages
                   ) == 1, "Catalog message should be emitted exactly once"