Example #1
0
def test_sink_orion_create_from_yaml_config():
    filename = pkg_resources.resource_filename(__name__, "data/orion.yml")
    sink = SinkOrion.from_config(filename)
    assert sink.hostname == "orion.fiware.org"
    assert sink.port == 1027
    assert sink.protocol == "https"
    assert sink.headers['Fiware-ServicePath'] == "Service-Path-1"
    assert sink.user == "foo"
    assert sink.passwd == "bar"
Example #2
0
def test_sink_orion_create_from_yaml_config_file_not_found():
    filename = pkg_resources.resource_filename(__name__,
                                               "data/orion-not-found.yml")
    with pytest.raises(SinkException, match=r".*Cannot read config.*"):
        sink = SinkOrion.from_config(filename)