예제 #1
0
 def test_warn_if_version_is_not_up_to_date(self, get, log):
     response = Mock(json=lambda: {'info': {'version': 0}})
     get.return_value = response
     main.check_mozregression_version()
     self.assertEqual(log.warning.call_count, 2)
예제 #2
0
 def test_version_is_upto_date(self, get, log):
     response = Mock(json=lambda: {'info': {'version': __version__}})
     get.return_value = response
     main.check_mozregression_version()
     self.assertFalse(log.critical.called)
예제 #3
0
 def test_Exception_error(self, get):
     get.side_effect = requests.RequestException
     # exception is handled inside main.check_mozregression_version
     main.check_mozregression_version()
     self.assertRaises(requests.RequestException, get)
예제 #4
0
 def test_warn_if_version_is_not_up_to_date(self, get, log):
     response = Mock(json=lambda: {'info': {'version': 0}})
     get.return_value = response
     main.check_mozregression_version()
     self.assertEqual(log.warning.call_count, 2)
예제 #5
0
 def test_Exception_error(self, get):
     get.side_effect = requests.RequestException
     # exception is handled inside main.check_mozregression_version
     main.check_mozregression_version()
     self.assertRaises(requests.RequestException, get)
예제 #6
0
 def test_version_is_upto_date(self, get, log):
     response = Mock(json=lambda: {'info': {'version': __version__}})
     get.return_value = response
     main.check_mozregression_version()
     self.assertFalse(log.critical.called)
예제 #7
0
 def test_warn_if_version_is_not_up_to_date(self, get):
     logger = Mock()
     response = Mock(json=lambda: {"info": {"version": 0}})
     get.return_value = response
     main.check_mozregression_version(logger)
     self.assertEqual(logger.warning.call_count, 2)
예제 #8
0
 def test_version_is_upto_date(self, get):
     logger = Mock()
     response = Mock(json=lambda: {"info": {"version": __version__}})
     get.return_value = response
     main.check_mozregression_version(logger)
     self.assertFalse(logger.critical.called)