{"action":"created","issue":{"url":"https://api.github.com/repos/gabrielfalcao/HTTPretty/issues/306","repository_url":"https://api.github.com/repos/gabrielfalcao/HTTPretty","labels_url":"https://api.github.com/repos/gabrielfalcao/HTTPretty/issues/306/labels{/name}","comments_url":"https://api.github.com/repos/gabrielfalcao/HTTPretty/issues/306/comments","events_url":"https://api.github.com/repos/gabrielfalcao/HTTPretty/issues/306/events","html_url":"https://github.com/gabrielfalcao/HTTPretty/issues/306","id":175369967,"number":306,"title":"Bug in matcher priority - plain URL overrides query string","user":{"login":"mikedlr","id":16256753,"avatar_url":"https://avatars.githubusercontent.com/u/16256753?v=3","gravatar_id":"","url":"https://api.github.com/users/mikedlr","html_url":"https://github.com/mikedlr","followers_url":"https://api.github.com/users/mikedlr/followers","following_url":"https://api.github.com/users/mikedlr/following{/other_user}","gists_url":"https://api.github.com/users/mikedlr/gists{/gist_id}","starred_url":"https://api.github.com/users/mikedlr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikedlr/subscriptions","organizations_url":"https://api.github.com/users/mikedlr/orgs","repos_url":"https://api.github.com/users/mikedlr/repos","events_url":"https://api.github.com/users/mikedlr/events{/privacy}","received_events_url":"https://api.github.com/users/mikedlr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-06T22:45:40Z","updated_at":"2016-12-16T18:02:58Z","closed_at":null,"body":"In my understanding and opinion the attached file shows a bug.  \n\nWhat do I do?\nextract and run the file\n\nWhat happens?\n- An exception \"we should never get here\"\n\nWhat did I expect to happen?\n- the lower priority matcher should be overridden by the higher priority one\n- the program should run and put out \"a okay\"\n\n[demo.py.zip](https://github.com/gabrielfalcao/HTTPretty/files/458463/demo.py.zip)\n"},"comment":{"url":"https://api.github.com/repos/gabrielfalcao/HTTPretty/issues/comments/267657117","html_url":"https://github.com/gabrielfalcao/HTTPretty/issues/306#issuecomment-267657117","issue_url":"https://api.github.com/repos/gabrielfalcao/HTTPretty/issues/306","id":267657117,"user":{"login":"mobedigg","id":913386,"avatar_url":"https://avatars.githubusercontent.com/u/913386?v=3","gravatar_id":"","url":"https://api.github.com/users/mobedigg","html_url":"https://github.com/mobedigg","followers_url":"https://api.github.com/users/mobedigg/followers","following_url":"https://api.github.com/users/mobedigg/following{/other_user}","gists_url":"https://api.github.com/users/mobedigg/gists{/gist_id}","starred_url":"https://api.github.com/users/mobedigg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mobedigg/subscriptions","organizations_url":"https://api.github.com/users/mobedigg/orgs","repos_url":"https://api.github.com/users/mobedigg/repos","events_url":"https://api.github.com/users/mobedigg/events{/privacy}","received_events_url":"https://api.github.com/users/mobedigg/received_events","type":"User","site_admin":false},"created_at":"2016-12-16T18:02:58Z","updated_at":"2016-12-16T18:02:58Z","body":"Hi, I made a fix in my fork https://github.com/mobedigg/HTTPretty `make unit functional` is passing without errors. For testing I used next code\r\n\r\n```\r\nimport httpretty\r\nimport requests\r\n\r\n\r\ndef bad_request(a, b, c):\r\n    raise Exception(\"we should never get here\")\r\n\r\n\r\nurl = \"http://example.com/a\"\r\nquery = \"?ab=cd\"\r\nquery2 = '?ab=zd'\r\nquery_notreg = '?bird=duck'\r\n\r\nhttpretty.HTTPretty.allow_net_connect = False\r\nhttpretty.enable()\r\nhttpretty.register_uri(\r\n    httpretty.GET, url + query,\r\n    match_querystring=True, status=200, body=\"a okay\",\r\n    priority=5)\r\n\r\nhttpretty.register_uri(\r\n    httpretty.GET, url + query2,\r\n    match_querystring=True, status=200, body=\"BEES!!!\",\r\n    priority=5)\r\n\r\nhttpretty.register_uri(\r\n    httpretty.GET, url + query_notreg,\r\n    match_querystring=False, status=200, body=\"BEES!!!\",\r\n    priority=5)\r\n\r\nhttpretty.register_uri(httpretty.GET, \"http://example.com/b\", body='b like a bee')\r\n\r\nif True:\r\n    httpretty.register_uri(httpretty.GET, url, match_querystring=False, status=200, body=bad_request, priority=0)\r\n\r\nr = requests.get(url + query2)\r\nprint (r.text)  # print \"BEES!!!\"\r\n\r\nr = requests.get(url + query)\r\nprint r.text  # print \"a okay\"\r\n\r\ntry:\r\n    r = requests.get(url + query_notreg)  # should fail\r\n    print r.text\r\nexcept requests.exceptions.ConnectionError:\r\n    print 'got exception'\r\n\r\n```"}}
{"actor":{"display_login":"mobedigg"}}