Skip to content

Commit

Permalink
#292 test and fix partial function
Browse files Browse the repository at this point in the history
  • Loading branch information
hjacobs committed Oct 4, 2016
1 parent 8a2594e commit ba11ff9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion connexion/mock.py
Expand Up @@ -8,7 +8,7 @@ def partial(func, **frozen):
def wrapper(*args, **kwargs):
for k, v in frozen.items():
kwargs[k] = v
func(*args, **kwargs)
return func(*args, **kwargs)
return wrapper


Expand Down
10 changes: 9 additions & 1 deletion tests/test_mock.py
@@ -1,8 +1,16 @@

from connexion.mock import MockResolver
from connexion.mock import MockResolver, partial
from connexion.operation import Operation


def test_partial():
def func(a, b):
return a + b

add_three = partial(func, a=3)
assert add_three(b=1) == 4


def test_mock_resolver():
resolver = MockResolver(mock_all=True)

Expand Down

0 comments on commit ba11ff9

Please sign in to comment.