Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fix a bug when having a character in the name that needs to be replaced #3

Merged
merged 1 commit into from

2 participants

@franckcuny

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.

@franckcuny franckcuny `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.
0a74dd1
@stanimoto stanimoto merged commit 793899a into stanimoto:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 24, 2012
  1. @franckcuny

    `eurl_repl` receives a match object argument.

    franckcuny authored
    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.
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 2 deletions.
  1. +1 −1  ddlockclient/__init__.py
  2. +7 −1 tests/test_client.py
View
2  ddlockclient/__init__.py
@@ -8,7 +8,7 @@
def eurl_repl(m):
- return "%%%02X" % ord(m)
+ return "%%%02X" % ord(m.group(1))
def eurl(name):
View
8 tests/test_client.py
@@ -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")
Something went wrong with that request. Please try again.