Commit d5336b37 by Őry Máté

dashboard: add doctest to connect_command_template_validator

parent 9e888e97
...@@ -34,6 +34,18 @@ def domain_validator(value): ...@@ -34,6 +34,18 @@ def domain_validator(value):
def connect_command_template_validator(value): def connect_command_template_validator(value):
"""Validate value as a connect command template.
>>> try: connect_command_template_validator("%(host)s")
... except ValidationError as e: print e
...
>>> connect_command_template_validator("%(host)s")
>>> try: connect_command_template_validator("%(host)s %s")
... except ValidationError as e: print e
...
[u'Invalid template string.']
"""
try: try:
value % { value % {
'username': "uname", 'username': "uname",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment