From 27f6745c3c9f3748c4ed689f18f4390f9f709e11 Mon Sep 17 00:00:00 2001 From: Jake Ichikawa Date: Thu, 21 Nov 2024 08:32:52 -0800 Subject: [PATCH] Format code. --- tabpy/tabpy_tools/client.py | 2 +- tests/unit/tools_tests/test_client.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tabpy/tabpy_tools/client.py b/tabpy/tabpy_tools/client.py index e37d2dff..8b959119 100644 --- a/tabpy/tabpy_tools/client.py +++ b/tabpy/tabpy_tools/client.py @@ -529,7 +529,7 @@ def _evaluate_remote_script(self, remote_script): msg = response.text.replace('null', 'Success') if "Ad-hoc scripts have been disabled" in msg: msg += "\n[Remote TabPy client not allowed.]" - + status_message = (f"{response.status_code} - {msg}\n") print(status_message) return status_message diff --git a/tests/unit/tools_tests/test_client.py b/tests/unit/tools_tests/test_client.py index fcf41ffe..d18043d0 100644 --- a/tests/unit/tools_tests/test_client.py +++ b/tests/unit/tools_tests/test_client.py @@ -21,10 +21,10 @@ def test_init(self): client = Client(endpoint="https://example.com/", query_timeout=-10.0) self.assertEqual(client._endpoint, "https://example.com/") self.assertEqual(client.query_timeout, 0.0) - + client = Client( - "http://example.com:442/", - remote_server=True, + "http://example.com:442/", + remote_server=True, localhost_endpoint="http://localhost:9004/" ) self.assertEqual(client._endpoint, "http://example.com:442/") @@ -104,14 +104,14 @@ def test_deploy_with_remote_server(self): client._evaluate_remote_script = mock_evaluate_remote_script client.deploy('name', lambda: True, 'description') mock_evaluate_remote_script.assert_called() - + def test_gen_remote_script(self): client = Client("http://example.com:9004/", remote_server=True) script = client._gen_remote_script() self.assertTrue("from tabpy.tabpy_tools.client import Client" in script) self.assertTrue("client = Client('http://example.com:9004/')" in script) self.assertFalse("client.set_credentials" in script) - + client.set_credentials("username", "password") script = client._gen_remote_script() self.assertTrue("client.set_credentials('username', 'password')" in script)