Skip to content

Commit ceef99a

Browse files
Add unit test
1 parent 731d7ed commit ceef99a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/unit/test_plugin_ssh.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,17 @@ def test_parse_target_address():
187187
"ipv6": "c001:d00d::1337/128",
188188
}
189189

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

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

195+
# Hack to work around invalid key
196+
setattr(test_namespace, "d", True)
197+
198+
address = plugin.parse_target_address(test_namespace, test_target)
199+
assert address == "123-123-123-123.ip.linodeusercontent.com"
200+
195201
# Hack to work around invalid key
196202
setattr(test_namespace, "6", True)
197203

0 commit comments

Comments
 (0)