2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-15 03:17:12 +00:00

all tests working except for git troggle and survex parsing

This commit is contained in:
2024-07-04 22:36:40 +03:00
parent 57bab53cec
commit 69ce1d91f3
2 changed files with 6 additions and 12 deletions

View File

@@ -85,8 +85,10 @@ class PageTests(TestCase):
def test_expoweb_dir_no_index(self):
response = self.client.get("/handbook/troggle")
content = response.content.decode()
# with open('testresponse.html','w') as tr:
# tr.writelines(content)
self.assertEqual(response.status_code, HTTPStatus.NOT_FOUND)
ph = r"Page not found handbook/troggle/index.html"
ph = r"Page not found 'handbook/troggle/index.html'"
phmatch = re.search(ph, content)
self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'")
@@ -170,7 +172,7 @@ class PageTests(TestCase):
response = self.client.get("/1234/115.htm")
self.assertEqual(response.status_code, HTTPStatus.NOT_FOUND)
content = response.content.decode()
ph = r"Page not found 1234/115.htm"
ph = r"Page not found '1234/115.htm'"
phmatch = re.search(ph, content)
self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'")
@@ -190,7 +192,7 @@ class PageTests(TestCase):
content = response.content.decode()
ph = r"115"
phmatch = re.search(ph, content)
self.assertIsNone(phmatch, "Failed to find expected text: '" + ph + "'")
self.assertIsNone(phmatch, "Unexpectedly found unexpected text: '" + ph + "'")
def test_page_ss(self):
response = self.client.get("/survey_scans/")
@@ -406,7 +408,7 @@ class PageTests(TestCase):
response = self.client.get("/photos/2018/PhilipSargent/_corin.jpeg") # does not exist
self.assertEqual(response.status_code, HTTPStatus.NOT_FOUND)
content = response.content.decode()
ph = r"<title>Page not found 2018/PhilipSargent/_corin.jpeg</title>"
ph = r"<title>Page not found '2018/PhilipSargent/_corin.jpeg'</title>"
phmatch = re.search(ph, content)
self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'")