Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

`eurl_repl` receives a match object argument.

As `eurl_repl` receives a match argument, it should do the transformation from
string to integer on the first group of the object, not the whole object.
  • Loading branch information...
commit 0a74dd1c6d00b27c2557548cf8828c7f67971164 1 parent bdeaf9c
Franck Cuny franckcuny authored
Showing with 8 additions and 2 deletions.
  1. +1 −1  ddlockclient/__init__.py
  2. +7 −1 tests/test_client.py
2  ddlockclient/__init__.py
View
@@ -8,7 +8,7 @@
def eurl_repl(m):
- return "%%%02X" % ord(m)
+ return "%%%02X" % ord(m.group(1))
def eurl(name):
8 tests/test_client.py
View
@@ -1,6 +1,6 @@
import unittest
import re
-from ddlockclient import DDLockClient, DDLock
+from ddlockclient import DDLockClient, DDLock, eurl
servers = ['localhost']
@@ -87,3 +87,9 @@ def test_e(self):
lock = self._lock('test')
self.assertTrue(isinstance(lock, DDLock),
"able to lock 'test' again")
+
+ def test_eurl(self):
+ name = eurl('foo|bar')
+ self.assertEqual(name, "foo%7Cbar")
+ name = eurl('foo|bar/baz')
+ self.assertEqual(name, "foo%7Cbar%2Fbaz")
Please sign in to comment.
Something went wrong with that request. Please try again.