def test_apache_check(self, mock_get): mock_get.return_value.headers = 'Apache/2.4.29 (Ubuntu)' responce = test_check_status() self.assertIn(responce.headers, 'Apache/2.4.29 (Ubuntu)')
def test_ok_check(self, mock_get): mock_get.return_value.ok = True responce = test_check_status() self.assertTrue(responce.ok)
def test_reason_check(self, mock_get): mock_get.return_value.reason = "OK" responce = test_check_status() self.assertEqual(responce.reason, "OK")
def test_text_check(self, mock_get): mock_get.return_value.text = "test_text" responce = test_check_status() self.assertIsInstance(responce.text, str)
def test_url(self, mock_get): mock_get.return_value.url = "http://192.168.102.98/opencart/" responce = test_check_status() self.assertEqual(responce.url, "http://192.168.102.98/opencart/")
def test_status(self, mock_get): mock_get.return_value.status_code = 200 responce = test_check_status() self.assertEqual(responce.status_code, 200)