Esempio n. 1
0
class URL:
    path: str
    instance: tc.Instance = tc.Instance()
    base_path: str = "api/versioned/v1"

    def __str__(self):
        origin = tc.instance.origin(self.instance)
        return f"{origin}/{self.base_path}/{self.path}"
Esempio n. 2
0
def instance() -> tc.Instance:
    return tc.Instance()
from getpass import getpass

import tamr_client as tc

username = input("Tamr Username:"******"Tamr Password:"******"http"
host = "localhost"
port = 9100

instance = tc.Instance(protocol=protocol, host=host, port=port)

project = tc.project.by_name(session, instance, "MasteringTutorial")

if not isinstance(project, tc.MasteringProject):
    raise RuntimeError(f"{project.name} is not a mastering project.")

operation_1 = tc.mastering.update_unified_dataset(session, project)
tc.operation.check(session, operation_1)

operation_2 = tc.mastering.generate_pairs(session, project)
tc.operation.check(session, operation_2)

operation_3 = tc.mastering.apply_feedback(session, project)
tc.operation.check(session, operation_3)

operation_4 = tc.mastering.update_pair_results(session, project)
Esempio n. 4
0
def instance():
    return tc.Instance()
Esempio n. 5
0
def test_client_set_protocol():
    instance = tc.Instance(protocol="https")
    assert tc.instance.origin(instance) == "https://localhost"
Esempio n. 6
0
def test_instance_default():
    instance = tc.Instance()
    assert tc.instance.origin(instance) == "http://localhost"
Esempio n. 7
0
def test_client_set_port():
    instance = tc.Instance(port=9100)
    assert tc.instance.origin(instance) == "http://localhost:9100"
Esempio n. 8
0
def test_client_set_host():
    instance = tc.Instance(host="123.123.123.123")
    assert tc.instance.origin(instance) == "http://123.123.123.123"