Skip to content

Commit

Permalink
Merge pull request #153 from transifex/fix_tests
Browse files Browse the repository at this point in the history
patch mock in order to make it work with functools
  • Loading branch information
ollandos authored Jan 24, 2017
2 parents 13467b6 + 279a407 commit 5828604
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions txclib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,12 @@ def files_in_project(curpath):


def encode_args(func):
# we have to patch func in order to make tests work.
# sadly mock does not have the attributes needed for functools
# so we need to set the manually
if not hasattr(func, '__name__'):
functools.update_wrapper(func, str.split, ('__name__', ))

@functools.wraps(func)
def decorated(*args, **kwargs):
new_args = _encode_anything(args)
Expand Down

0 comments on commit 5828604

Please sign in to comment.