Skip to content

Commit ed5ac6f

Browse files
committed
Better test trailing slash.
1 parent 32468b5 commit ed5ac6f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/test_http.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import requests
1313

1414
from mocket import Mocket, Mocketizer, mocketize
15-
from mocket.mockhttp import Entry, Response
15+
from mocket.mocks.mockhttp import Entry, Response
1616

1717

1818
class HttpTestCase(TestCase):
@@ -448,3 +448,10 @@ def test_add_trailing_slash(self):
448448
url = "http://testme.org"
449449
entry = Entry(url, "GET", [Response(body='{"foo":"bar0"}', status=200)])
450450
self.assertEqual(entry.path, "/")
451+
452+
@mocketize
453+
def test_mocket_with_no_path(self):
454+
Entry.register(Entry.GET, "http://httpbin.local", Response(status=202))
455+
response = urlopen("http://httpbin.local/")
456+
self.assertEqual(response.code, 202)
457+
self.assertEqual(Mocket._entries[("httpbin.local", 80)][0].path, "/")

0 commit comments

Comments
 (0)