Permalink
Browse files

Merge pull request #3 from franckcuny/master

fix a bug when having a character in the name that needs to be replaced
  • Loading branch information...
2 parents bdeaf9c + 0a74dd1 commit 793899aa13f174612bc11afc782acc42df5b8cdd @stanimoto committed May 24, 2012
Showing with 8 additions and 2 deletions.
  1. +1 −1 ddlockclient/__init__.py
  2. +7 −1 tests/test_client.py
View
@@ -8,7 +8,7 @@
def eurl_repl(m):
- return "%%%02X" % ord(m)
+ return "%%%02X" % ord(m.group(1))
def eurl(name):
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")

0 comments on commit 793899a

Please sign in to comment.