def test_model_perform_all_message_logging(self): model = VolumeViewModel() model.set_start_value(3) model.set_end_value(10) model.perform() log_message = [ 'Hi!', 'Setting radius value - 3', 'Setting height value - 10', 'Radiobutton 0 (cube) selected', 'Result = 1000' ] self.assertEqual(log_message, model.logger.get_log_messages()[-5:])
def test_model_sphere_message_logging(self): model = VolumeViewModel() model.set_figure_type(1) model.set_start_value(10) model.set_end_value(3) model.perform() log_message = [ 'Hi!', 'Setting radius value - 10', 'Setting height value - 3', 'Radiobutton 1 (sphere) selected', 'Result = 4188.79' ] self.assertEqual(log_message, model.logger.get_log_messages()[-5:])
def test_model_perform_logging(self): model = VolumeViewModel() model.set_start_value(3) model.set_end_value(10) model.perform() self.assertEqual('Result = 1000', model.logger.get_last_message())
def test_set_end_value_logging(self): model = VolumeViewModel() model.set_end_value(6) self.assertEqual('Setting height value - 6', model.logger.get_last_message())
def test_correct_set_value(self): model = VolumeViewModel() model.set_start_value(3) model.set_end_value(5) self.assertEqual(3, model.get_start_value()) self.assertEqual(5, model.get_end_value())
def test_button_disabled_3_none(self): model = VolumeViewModel(3, 5) model.set_end_value(None) self.assertEqual('disabled', model.is_button_enable())