Exemple #1
0
def test_sink_orion_write_with_auth(requests_mock):
    sink = SinkOrion(token="00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff")
    requests_mock.post("http://127.0.0.1:1026/v2/entities?options=upsert",
                       request_headers={
                           'Content-Type':
                           'application/json',
                           'X-Auth-Token':
                           '00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff'
                       })
    sink.write(msg=r'{"id": "Room1", "type": "Room")')
Exemple #2
0
def test_sink_orion_write_with_auth_env(mocker, requests_mock):
    mocker.patch.dict(
        os.environ,
        {'ORION_TOKEN': '00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff'})
    sink = SinkOrion()
    requests_mock.post("http://127.0.0.1:1026/v2/entities?options=upsert",
                       request_headers={
                           'Content-Type':
                           'application/json',
                           'X-Auth-Token':
                           '00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff'
                       })
    sink.write(msg=r'{"id": "Room1", "type": "Room")')
Exemple #3
0
def test_sink_orion_write(requests_mock):
    sink = SinkOrion()
    requests_mock.post("http://127.0.0.1:1026/v2/entities?options=upsert",
                       request_headers={'Content-Type': 'application/json'})
    sink.write(msg=r'{"id": "Room1", "type": "Room")')