From 5c7b089080a918b643a8b2807432b527331ff7ed Mon Sep 17 00:00:00 2001 From: sqozz Date: Sat, 7 Apr 2018 23:07:43 +0200 Subject: [PATCH] Split tests by cases --- schort_functional_tests.py | 42 ++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/schort_functional_tests.py b/schort_functional_tests.py index 0f730b5..52dcef9 100755 --- a/schort_functional_tests.py +++ b/schort_functional_tests.py @@ -5,14 +5,8 @@ import requests BASE_URL="http://localhost:5000" -class SchortFunctionalTestCase(unittest.TestCase): - def setUp(self): - # maybe later - pass - - def tearDown(self): - # maybe later - pass +class TestCase(unittest.TestCase): + pass def assertPostReq(self, url, data = {}): req = requests.post(url, data=data) @@ -24,31 +18,43 @@ class SchortFunctionalTestCase(unittest.TestCase): self.assertEqual(req.status_code, 200) return req + +class SchortBasicTests(TestCase): def test_entry_page(self): + """HTML exists in root page""" req = self.assertGetReq(BASE_URL + "/") content = req.text self.assertNotEqual(len(content), 0, msg="Get request content was empty.") self.assertRegex(content, ".*\