{"action":"opened","issue":{"url":"https://api.github.com/repos/uber/doubles/issues/115","repository_url":"https://api.github.com/repos/uber/doubles","labels_url":"https://api.github.com/repos/uber/doubles/issues/115/labels{/name}","comments_url":"https://api.github.com/repos/uber/doubles/issues/115/comments","events_url":"https://api.github.com/repos/uber/doubles/issues/115/events","html_url":"https://github.com/uber/doubles/issues/115","id":157949459,"number":115,"title":"Make doubles work with partials","user":{"login":"rabbbit","id":290258,"avatar_url":"https://avatars.githubusercontent.com/u/290258?v=3","gravatar_id":"","url":"https://api.github.com/users/rabbbit","html_url":"https://github.com/rabbbit","followers_url":"https://api.github.com/users/rabbbit/followers","following_url":"https://api.github.com/users/rabbbit/following{/other_user}","gists_url":"https://api.github.com/users/rabbbit/gists{/gist_id}","starred_url":"https://api.github.com/users/rabbbit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rabbbit/subscriptions","organizations_url":"https://api.github.com/users/rabbbit/orgs","repos_url":"https://api.github.com/users/rabbbit/repos","events_url":"https://api.github.com/users/rabbbit/events{/privacy}","received_events_url":"https://api.github.com/users/rabbbit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-01T16:21:20Z","updated_at":"2016-06-01T16:21:20Z","closed_at":null,"body":"Hey-oh,\r\n\r\nI realize I should put up a PR instead, but as a step one lets see if you know about it already.\r\n\r\nShould doubles work with partials? Tried to make it work, but everything seems to be failing :(\r\n\r\n```\r\nfrom functools import partial\r\n\r\nfrom doubles import expect\r\n\r\n\r\ndef some_function(args1, arg2):\r\n    print args1, arg2\r\n\r\nmy_partial = partial(some_function, arg2=2)\r\n\r\n\r\n# need this to make doubles work nicely I think?\r\nclass Namespace(object):\r\n    some_function = some_function\r\n    my_partial = my_partial\r\n\r\n\r\ndef test_function():\r\n    n = Namespace()\r\n    expect(n).some_function.with_args(arg2=2).once()\r\n    n.some_function(arg2=2)\r\n\r\n\r\ndef test_partial():\r\n    n = Namespace()\r\n    expect(n).some_function.with_args(arg2=2).once()\r\n    n.my_partial(n)\r\n\r\n\r\ndef test_another_partial():\r\n    n = Namespace()\r\n    expect(n).my_partial.with_args().once()\r\n    n.my_partial(arg2=2)\r\n\r\n\r\ndef test_more_partial():\r\n    n = Namespace()\r\n    expect(n.my_partial).__call__.with_args().once()\r\n    n.my_partial(arg2=2)\r\n```"}}
{"actor":{"display_login":"rabbbit"}}