Commit dae4335e authored by Robin Obůrka's avatar Robin Obůrka

Fix regexp for message type and add few test around it

This was necessary because original regexp refused some allowed messages
parent 490ab09a
......@@ -4,7 +4,7 @@ import msgpack
from .exceptions import *
SN_MSG_REGEXP = "^([a-z0-9_]|[a-z0-9_]+/)([a-z0-9_]+/)+[a-z0-9_]+$"
SN_MSG_REGEXP = "^([a-z0-9_]+/)*[a-z0-9_]+$"
SN_MSG = re.compile(SN_MSG_REGEXP)
def parse_msg(data):
......
......@@ -7,6 +7,8 @@ def good_type():
return "sentinel/tests/good_string"
@pytest.fixture(params=[
"sentinel",
"sentinel/tests",
"sentinel/tests/goodstring",
"sentinel/tests/good/string",
"sentinel/tests/good_string",
......@@ -30,7 +32,10 @@ def good_types(request):
"sentinel/tests/bro?ken",
"sentinel/tests/bro@ken",
"sentinel//broken",
"sentinel//broken",
"s//b",
"sentinel/",
"/sentinel",
""
])
def bad_types(request):
......
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 to comment