Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Christoph Kuhnke <[email protected]>
  • Loading branch information
tkilias and ckunki authored Jan 25, 2024
1 parent a64c680 commit 67f5889
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/unit/test_current_container_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,12 @@ def __init__(self, containers: List[Dict[str, str]], ip_addresses: List[str]):
)


def test_ips_in_ips_of_single_container():
def test_single_container():
"""
Verify finding a single container with all ip addresses exposed by its networks being contained in the given whitelist.
"""
test_setup = TestSetup(
# each container is defined by a dict specifying its networks.
containers=[
{"test1": "192.168.0.1", "test2": "192.168.1.1"},
{"test1": "192.168.2.1", "test2": "192.168.3.1"},
Expand All @@ -87,7 +91,7 @@ def test_ips_in_ips_of_single_container():
)


def test_ips_not_in_container_ips():
def test_no_matching_container():
test_setup = TestSetup(
containers=[
{"test1": "192.168.0.1", "test2": "192.168.1.1"},
Expand All @@ -103,7 +107,7 @@ def test_ips_not_in_container_ips():
assert result == None


def test_ips_in_ips_of_multiple_container():
def test_multiple_containers_matching():
test_setup = TestSetup(
containers=[
{"test1": "192.168.0.1", "test2": "192.168.1.1"},
Expand Down

0 comments on commit 67f5889

Please sign in to comment.