Example #1
0
 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)')
Example #2
0
 def test_ok_check(self, mock_get):
     mock_get.return_value.ok = True
     responce = test_check_status()
     self.assertTrue(responce.ok)
Example #3
0
 def test_reason_check(self, mock_get):
     mock_get.return_value.reason = "OK"
     responce = test_check_status()
     self.assertEqual(responce.reason, "OK")
Example #4
0
 def test_text_check(self, mock_get):
     mock_get.return_value.text = "test_text"
     responce = test_check_status()
     self.assertIsInstance(responce.text, str)
Example #5
0
 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/")
Example #6
0
 def test_status(self, mock_get):
     mock_get.return_value.status_code = 200
     responce = test_check_status()
     self.assertEqual(responce.status_code, 200)