def test_check_script_consul_1(self): ServiceCheck.consul_version = (0, 9, 6) params = self.params_script with pytest.deprecated_call(): check = ServiceCheck.script(self.dummyservice, params) self.assertEqual(check['script'], 'command arg1 arg2') self.assertEqual(check['interval'], '5s') self.assertEqual(len(check), 2)
def test_check_script_replace(self): params = self.params_script params['script'] = 'command $SERVICE_IP:$SERVICE_PORT' check = ServiceCheck.script(self.dummyservice, params) self.assertEqual(check['args'], ['command', '6.6.6.6:666'])
def test_check_script_empty(self): params = self.params_script params['script'] = '' check = ServiceCheck.script(self.dummyservice, params) self.assertIsNone(check)
def test_check_script(self): params = self.params_script check = ServiceCheck.script(self.dummyservice, params) self.assertEqual(check['args'], ['command', 'arg1', 'arg2']) self.assertEqual(check['interval'], '5s') self.assertEqual(len(check), 2)