def test_invalid_message_type(self): assert_raise_library_error( lambda: cmd_sbd.set_message(self.env, "device", "node1", "message"), ( Severities.ERROR, report_codes.INVALID_OPTION_VALUE, { "option_name": "message", "option_value": "message", "allowed_values": settings.sbd_message_types, } ) )
def test_failuer(self): runner.set_runs( self.fixture_call_sbd_message("device", "node", "test", "error", 1) ) assert_raise_library_error( lambda: cmd_sbd.set_message(self.env, "device", "node", "test"), ( Severities.ERROR, report_codes.SBD_DEVICE_MESSAGE_ERROR, { "device": "device", "node": "node", "message": "test", "reason": "error", } ) ) runner.assert_everything_launched()
def test_empty_options(self): assert_raise_library_error( lambda: cmd_sbd.set_message(self.env, "", "", ""), ( Severities.ERROR, report_codes.REQUIRED_OPTION_IS_MISSING, { "option_names": ["device", "node"], "option_type": None, } ), ( Severities.ERROR, report_codes.INVALID_OPTION_VALUE, { "option_name": "message", "option_value": "", "allowed_values": settings.sbd_message_types, } ) )
def test_success(self): runner.set_runs(self.fixture_call_sbd_message("device", "node", "test")) cmd_sbd.set_message(self.env, "device", "node", "test") runner.assert_everything_launched()
def test_success(self): self.config.runner.sbd.set_device_message("device", "node", "test") cmd_sbd.set_message(self.env_assist.get_env(), "device", "node", "test")