71
|
1 # I m p o r t s
|
|
2
|
|
3 import os, sys
|
|
4 import requests
|
|
5 from .. import ServerFixture, RoutesFixture
|
|
6
|
|
7 # C l a s s e s
|
|
8
|
|
9 class Fixture01(ServerFixture):
|
|
10 # There should be no errors when we load this.
|
|
11 def runTest(self):
|
|
12 self.assertEqual(self.errors, 0)
|
|
13
|
|
14 class Fixture02(RoutesFixture):
|
|
15 # Request something that doesn't exist. We should get our custom error
|
|
16 # page.
|
|
17 def test_01_404(self):
|
|
18 response = requests.get("http://localhost:{0}/boogers/".format(self.port))
|
|
19 self.assertEqual(response.status_code, 404)
|
|
20 self.assertTrue("I/O, I/O, it’s off to disk I go!" in response.text)
|