Skip to content
Snippets Groups Projects
Commit bd28dc50 authored by Vincent Texier's avatar Vincent Texier
Browse files

[fix] #119 fix HEAD messages software version regexp to be compliant with the WS2Pv1 protocol

parent f44302c3
No related branches found
No related tags found
2 merge requests!101Release 0.57.0,!96[fix] #119 fix HEAD messages software version regexp to be compliant with the WS2Pv1 protocol
......@@ -124,7 +124,7 @@ class HeadV1:
"({ws2pid}):({software}):({software_version}):({pow_prefix})(?::)?(.*)".format(
ws2pid=WS2PID_REGEX,
software="[A-Za-z-_]+",
software_version="[0-9]+[.][0-9]+[.][0-9]+",
software_version="[0-9]+[.][0-9]+[.][0-9]+[-\\w]*",
pow_prefix="[0-9]+",
)
)
......
......@@ -30,7 +30,7 @@ class TestWS2PHeads(unittest.TestCase):
headv1, _ = HeadV1.from_inline(
"WS2POCAIC:HEAD:1:HbTqJ1Ts3RhJ8Rx4XkNyh1oSKmoZL1kY5U7t9mKTSjAB:"
"102131-0000066028B991BDFE3FF6DBA84EF519F76B62EA3787BC29D9A05557675B1F16:1152e46e:"
"duniter:1.6.21:1",
"duniter:1.6.21-beta:1",
"ZGpT8HG4uX5Hc96gqhzIkkELVjGQKDp2/L+7BTFG5ODxGYWd2VX/H+hdZRqf0iUWRNuhxlequ68kkwMaE6ymBw==",
)
......@@ -38,7 +38,7 @@ class TestWS2PHeads(unittest.TestCase):
self.assertEqual(headv1.v0.api.private, "OCA")
self.assertEqual(headv1.v0.head.version, 1)
self.assertEqual(headv1.software, "duniter")
self.assertEqual(headv1.software_version, "1.6.21")
self.assertEqual(headv1.software_version, "1.6.21-beta")
self.assertEqual(headv1.pow_prefix, 1)
def test_ws2p_headv2(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment