MCPcopy Index your code
hub / github.com/webpy/webpy / test_reloader_nested

Method test_reloader_nested

tests/test_application.py:60–82  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

58 self.assertEqual(app.request("/").data, b"c")
59
60 def test_reloader_nested(self):
61 try:
62 shutil.rmtree("testpackage")
63 except OSError:
64 pass
65 os.mkdir("testpackage")
66 write("testpackage/__init__.py", "")
67 write("testpackage/bar.py", data % dict(classname="a", output="a"))
68 import testpackage.bar
69
70 app = testpackage.bar.app
71
72 self.assertEqual(app.request("/").data, b"a")
73
74 # test class change
75 time.sleep(1)
76 write("testpackage/bar.py", data % dict(classname="a", output="b"))
77 self.assertEqual(app.request("/").data, b"b")
78
79 # test urls change
80 time.sleep(1)
81 write("testpackage/bar.py", data % dict(classname="c", output="c"))
82 self.assertEqual(app.request("/").data, b"c")
83
84 def testUppercaseMethods(self):
85 urls = ("/", "hello")

Callers

nothing calls this directly

Calls 2

writeFunction · 0.85
requestMethod · 0.80

Tested by

no test coverage detected