Skip to content

Commit 908770a

Browse files
committed
Added test for nebula_host_uri config param
1 parent 8bd44fa commit 908770a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/test_nebula_python_sdk.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,3 +454,18 @@ def test_cron_job_flow(self, cron_job="unit_test_cron_job"):
454454
reply = nebula_connection_object.delete_cron_job(cron_job)
455455
self.assertEqual(reply["status_code"], 200)
456456
self.assertEqual(reply["reply"], {})
457+
458+
def test_nebula_connection_with_host_uri(self):
459+
nebula_user = os.getenv("NEBULA_TEST_USERNAME", "nebula")
460+
nebula_password = os.getenv("NEBULA_TEST_PASSWORD", "nebula")
461+
nebula_host_uri = os.getenv("NEBULA_HOST_URI", "http://127.0.0.1:80")
462+
connection = Nebula(username=nebula_user, password=nebula_password, host_uri=nebula_host_uri)
463+
464+
# check that the host param is set correctly
465+
self.assertEqual(connection.host, nebula_host_uri)
466+
467+
# check that connects to manager successfully
468+
reply = connection.check_api()
469+
self.assertEqual(reply["status_code"], 200)
470+
self.assertEqual(reply["reply"]["api_available"], True)
471+

0 commit comments

Comments
 (0)