Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
jrouzierinverse committed Feb 3, 2025
1 parent 115343e commit e77a86e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/unit/test_plugin_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,17 @@ def test_parse_target_address():
"ipv6": "c001:d00d::1337/128",
}

test_namespace = argparse.Namespace(**{"6": False})
test_namespace = argparse.Namespace(**{"6": False, "d": False})

address = plugin.parse_target_address(test_namespace, test_target)
assert address == "123.123.123.123"

# Hack to work around invalid key
setattr(test_namespace, "d", True)

address = plugin.parse_target_address(test_namespace, test_target)
assert address == "123-123-123-123.ip.linodeusercontent.com"

# Hack to work around invalid key
setattr(test_namespace, "6", True)

Expand Down

0 comments on commit e77a86e

Please sign in to comment.