Esempio n. 1
0
def test_delete_result():
    td = client.Client("APIKEY")
    td._api = mock.MagicMock()
    td._api.delete_result = mock.MagicMock()
    td.delete_result("name")
    td.api.delete_result("name")
Esempio n. 2
0
def test_add_user():
    td = client.Client("APIKEY")
    td._api = mock.MagicMock()
    td._api.add_user = mock.MagicMock()
    td.add_user("name", "org", "email", "password")
    td.api.add_user("name", "org", "email", "password")
Esempio n. 3
0
def test_update_schema():
    td = client.Client("APIKEY")
    td._api = mock.MagicMock()
    td._api.update_schema = mock.MagicMock()
    td.update_schema("db_name", "table_name", {"schema": "v"})
    td.api.update_schema.assert_called_with("db_name", "table_name", '{"schema": "v"}')
Esempio n. 4
0
def test_client_apikey():
    td = client.Client("foo")
    assert td.api.apikey == "foo"
    assert td.apikey == "foo"
Esempio n. 5
0
def test_remove_apikey():
    td = client.Client("APIKEY")
    td._api = mock.MagicMock()
    td._api.remove_apikey = mock.MagicMock()
    td.remove_apikey("user", "apikey")
    td.api.remove_apikey("user", "apikey")
Esempio n. 6
0
def test_test_access_control():
    td = client.Client("APIKEY")
    td._api = mock.MagicMock()
    td._api.test_access_control = mock.MagicMock()
    td.test_access_control("subject", "action", "scope")
    td.api.test_access_control("subject", "action", "scope")
Esempio n. 7
0
def test_delete_database():
    td = client.Client("APIKEY")
    td._api = mock.MagicMock()
    td._api.delete_database = mock.MagicMock()
    td.delete_database("db_name")
    td.api.delete_database.assert_called_with("db_name")
Esempio n. 8
0
def test_list_apikeys():
    td = client.Client("APIKEY")
    td._api = mock.MagicMock()
    td._api.list_apikeys = mock.MagicMock()
    td.list_apikeys("user")
    td.api.list_apikeys("user")
Esempio n. 9
0
def test_create_database():
    td = client.Client("APIKEY")
    td._api = mock.MagicMock()
    td._api.create_database = mock.MagicMock()
    td.create_database("db_name", param1="param1")
    td.api.create_database.assert_called_with("db_name", param1="param1")
Esempio n. 10
0
def test_commit_bulk_import():
    td = client.Client("APIKEY")
    td._api = mock.MagicMock()
    td._api.commit_bulk_import = mock.MagicMock()
    td.commit_bulk_import("name")
    td.api.commit_bulk_import.assert_called_with("name")
Esempio n. 11
0
def test_kill():
    td = client.Client("APIKEY")
    td._api = mock.MagicMock()
    td._api.kill = mock.MagicMock()
    job = td.kill("12345")
    td.api.kill.assert_called_with("12345")
Esempio n. 12
0
def test_job_status():
    td = client.Client("APIKEY")
    td._api = mock.MagicMock()
    td._api.job_status = mock.MagicMock()
    job = td.job_status("12345")
    td.api.job_status.assert_called_with("12345")
Esempio n. 13
0
def test_server_status():
    td = client.Client("APIKEY")
    td._api = mock.MagicMock()
    td._api.server_status = mock.MagicMock()
    td.server_status()
    td.api.server_status.assert_called_with()
Esempio n. 14
0
def test_remove_user():
    td = client.Client("APIKEY")
    td._api = mock.MagicMock()
    td._api.remove_user = mock.MagicMock()
    td.remove_user("name")
    td.api.remove_user("name")
Esempio n. 15
0
def test_bulk_import_delete_part():
    td = client.Client("APIKEY")
    td._api = mock.MagicMock()
    td._api.bulk_import_delete_part = mock.MagicMock()
    td.bulk_import_delete_part("name", "part_name")
    td.api.bulk_import_delete_part.assert_called_with("name", "part_name")
Esempio n. 16
0
def test_change_email():
    td = client.Client("APIKEY")
    td._api = mock.MagicMock()
    td._api.change_email = mock.MagicMock()
    td.change_email("user", "email")
    td.api.change_email("user", "email")
Esempio n. 17
0
def test_list_bulk_import_parts():
    td = client.Client("APIKEY")
    td._api = mock.MagicMock()
    td._api.list_bulk_import_parts = mock.MagicMock()
    td.list_bulk_import_parts("name")
    td.api.list_bulk_import_parts.assert_called_with("name")
Esempio n. 18
0
def test_add_apikey():
    td = client.Client("APIKEY")
    td._api = mock.MagicMock()
    td._api.add_apikey = mock.MagicMock()
    td.add_apikey("user")
    td.api.add_apikey("user")
Esempio n. 19
0
def test_delete_schedule():
    td = client.Client("APIKEY")
    td._api = mock.MagicMock()
    td._api.delete_schedule = mock.MagicMock()
    td.delete_schedule("name")
    td.api.delete_schedule("name")
Esempio n. 20
0
def test_change_my_password():
    td = client.Client("APIKEY")
    td._api = mock.MagicMock()
    td._api.change_my_password = mock.MagicMock()
    td.change_my_password("old_password", "password")
    td.api.change_my_password("old_password", "password")
Esempio n. 21
0
def test_update_schedule():
    td = client.Client("APIKEY")
    td._api = mock.MagicMock()
    td._api.update_schedule = mock.MagicMock()
    td.update_schedule("name", {"foo": "bar"})
    td.api.update_schedule("name", {"foo": "bar"})
Esempio n. 22
0
def test_swap_table():
    td = client.Client("APIKEY")
    td._api = mock.MagicMock()
    td._api.swap_table = mock.MagicMock()
    td.swap_table("db_name", "table_name1", "table_name2")
    td.api.swap_table.assert_called_with("db_name", "table_name1", "table_name2")
Esempio n. 23
0
def test_create_result():
    td = client.Client("APIKEY")
    td._api = mock.MagicMock()
    td._api.create_result = mock.MagicMock()
    td.create_result("name", "url", {"foo": "bar"})
    td.api.create_result("name", "url", {"foo": "bar"})
Esempio n. 24
0
def test_update_expire():
    td = client.Client("APIKEY")
    td._api = mock.MagicMock()
    td._api.update_expire = mock.MagicMock()
    td.update_expire("db_name", "table_name", 7)
    td.api.update_expire.assert_called_with("db_name", "table_name", 7)
Esempio n. 25
0
def test_create_log_table():
    td = client.Client("APIKEY")
    td._api = mock.MagicMock()
    td._api.create_log_table = mock.MagicMock()
    td.create_log_table("db_name", "table_name")
    td.api.create_log_table.assert_called_with("db_name", "table_name")