Skip to content

Commit

Permalink
Mem (1/3): Add unit test for format_server_url
Browse files Browse the repository at this point in the history
  • Loading branch information
cjao committed Jul 14, 2023
1 parent fec33bb commit 0556d23
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/covalent_tests/shared_files/utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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}"

0 comments on commit 0556d23

Please sign in to comment.