def testing_FindingR0(self): tester = app.test_client(self) self.assertEqual( tester.get("/?country=UAE&status=Find R0").status, '200 OK')
def test_response(self): # self.assertEqual(resp.status,'200 OK') tester = app.test_client(self) response = tester.get("/") statuscode = response.status_code self.assertEqual(statuscode, 200)
def testing_DailyDeaths(self): tester = app.test_client(self) self.assertEqual( tester.get("/?country=palastine&status=deaths").status, '200 OK')
def testing_DeathsCum(self): tester = app.test_client(self) self.assertEqual( tester.get("/?country=Russia&status=deaths_cum").status, '200 OK')
def testing_DailyCases(self): tester = app.test_client(self) self.assertEqual( tester.get("/?country=ksa&status=cases").status, '200 OK')
def testing_daily_deaths(self): tester = app.test_client(self) self.assertEqual( tester.get("/?country=germany&status=deaths").status, '200 OK')
def testing_CasesCum(self): tester = app.test_client(self) self.assertEqual( tester.get("/?country=spain&status=cases_cum").status, '200 OK')
def testing_daily_cases(self): tester = app.test_client(self) self.assertEqual( tester.get("/?country=france&status=cases").status, '200 OK')
def testing_cases_cum(self): tester = app.test_client(self) # response = tester.get("/") self.assertEqual( tester.get("/?country=egypt&status=cases_cum").status, '200 OK')
def test_welcome_route_works_as_expected(self): tester = app.test_client(self) response = tester.get("/") self.assertIn(b'COVID-19 Monitor', response.data) # Ensure that welcome page loads
def test_message(self): tester = app.test_client(self) response = tester.get("/") self.assertTrue(b'cases' in response.data)
def test_content(self): tester = app.test_client(self) response = tester.get("/") self.assertEqual(response.content_type, 'text/html; charset=utf-8')