class TestSlotReplacement(UnitTestCase): def setUp(self): super(TestSlotReplacement, self).setUp() self.job = Job(slug='cthulhubot-test-output-job').get_domain_object() def test_slot_command_propagated_according_to_config(self): config = { 'command' : 'cthulhubot-test-helper-echo', 'parameters' : {} } self.job.update_command_config(0, config) self.assert_equals(config['command'], self.job.get_configuration_parameters()[0]['command']) def test_update_with_command_from_other_slot_prohibited(self): self.assert_raises(ValueError, self.job.update_command_config, 0, {'command' : 'cthulhubot-sleep', 'parameters' : {}}) def test_attempt_to_work_with_unconfigured_slot_raises_error(self): self.assert_raises(UnconfiguredCommandError, self.job.get_commands)