Ejemplo n.º 1
0
def test_loading__invalid__configuration__schema():
    stream = CatStream(1)
    stream.schema = deepcopy(stream.schema)
    stream.schema['schema']['type'] = 'invalid type for a JSON Schema'

    with pytest.raises(Exception, match=r'.*invalid JSON Schema instance.*'):
        main(CONFIG, input_stream=stream)
Ejemplo n.º 2
0
def test_upsert__invalid__primary_key_change(db_cleanup):
    stream = CatStream(100)
    main(CONFIG, input_stream=stream)

    stream = CatStream(100)
    schema = deepcopy(stream.schema)
    schema['key_properties'].append('name')
    stream.schema = schema

    with pytest.raises(postgres.PostgresError, match=r'.*key_properties.*'):
        main(CONFIG, input_stream=stream)
Ejemplo n.º 3
0
def test_loading__invalid__column_type_change__pks__nullable():
    main(CONFIG, input_stream=CatStream(20))

    stream = CatStream(20)
    stream.schema = deepcopy(stream.schema)
    stream.schema['schema']['properties']['id'] = json_schema.make_nullable(
        stream.schema['schema']['properties']['id'])

    with pytest.raises(postgres.PostgresError,
                       match=r'.*key_properties. type change detected'):
        main(CONFIG, input_stream=stream)