Exemplo n.º 1
0
def test_get_new_client_with_token():
    wrap = StreamWrapper(
        "https://speckle.xyz/streams/4c3ce1459c/commits/8b9b831792")
    client = wrap.get_client()
    client = wrap.get_client(token="super-secret-token")

    assert client.account.token == "super-secret-token"
Exemplo n.º 2
0
def processItem(item):
    url, token = item
    # provide any stream, branch, commit, object, or globals url
    wrapper = StreamWrapper(url)
    client = wrapper.get_client()
    client.authenticate_with_token(token)
    streams = streamsByClient(client)
    stream = streamByID([streams, wrapper.stream_id])
    return stream
Exemplo n.º 3
0
def test_get_transport_with_token():
    wrap = StreamWrapper(
        "https://speckle.xyz/streams/4c3ce1459c/commits/8b9b831792")
    client = wrap.get_client()
    assert not client.account.token  # unauthenticated bc no local accounts

    transport = wrap.get_transport(token="super-secret-token")

    assert transport is not None
    assert client.account.token == "super-secret-token"
Exemplo n.º 4
0
def processItem(item):
    url, token = item
    # provide any stream, branch, commit, object, or globals url
    wrapper = StreamWrapper(url)
    client = wrapper.get_client()
    client.authenticate_with_token(token)
    print("Client", client)
    streams = streamsByClient(client)
    print("Streams", streams)
    stream = streamByID([streams, wrapper.stream_id])
    print("Stream", stream)
    commits = client.commit.list(wrapper.stream_id)
    commit = commitByID([commits, wrapper.commit_id])
    print(commit)
    return commit
Exemplo n.º 5
0
def test_get_client_without_auth():
    wrap = StreamWrapper(
        "https://speckle.xyz/streams/4c3ce1459c/commits/8b9b831792")
    client = wrap.get_client()

    assert client is not None