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}"
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)
def instance(): return tc.Instance()
def test_client_set_protocol(): instance = tc.Instance(protocol="https") assert tc.instance.origin(instance) == "https://localhost"
def test_instance_default(): instance = tc.Instance() assert tc.instance.origin(instance) == "http://localhost"
def test_client_set_port(): instance = tc.Instance(port=9100) assert tc.instance.origin(instance) == "http://localhost:9100"
def test_client_set_host(): instance = tc.Instance(host="123.123.123.123") assert tc.instance.origin(instance) == "http://123.123.123.123"