From 0556d239bc957f02886b81048ea1eb8ddd5f2f5b Mon Sep 17 00:00:00 2001 From: Casey Jao <casey@agnostiq.ai> Date: Fri, 14 Jul 2023 09:30:58 -0400 Subject: [PATCH] Mem (1/3): Add unit test for format_server_url --- tests/covalent_tests/shared_files/utils_test.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/covalent_tests/shared_files/utils_test.py b/tests/covalent_tests/shared_files/utils_test.py index 46613452b..6a33da1b3 100644 --- a/tests/covalent_tests/shared_files/utils_test.py +++ b/tests/covalent_tests/shared_files/utils_test.py @@ -23,7 +23,8 @@ import pytest -from covalent._shared_files.utils import filter_null_metadata +from covalent._shared_files.config import get_config +from covalent._shared_files.utils import filter_null_metadata, format_server_url @pytest.mark.parametrize( @@ -38,3 +39,14 @@ def test_filter_null_metadata(meta_dict, expected): """Test the filter null metadata function.""" filtered = filter_null_metadata(meta_dict) assert filtered == expected + + +def test_format_server_url(): + """Test the convenience function to format server urls.""" + + base_url = format_server_url() + + addr = get_config("dispatcher.address") + port = int(get_config("dispatcher.port")) + + assert base_url == f"http://{addr}:{port}"