From d72bc1b3403d4aafb9d84ab95114669172e72b2f Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 30 Jan 2013 18:18:28 +0000 Subject: [PATCH] correct error text --- .../openlp_core_lib/test_registry.py | 6 +-- .../openlp_core_ui/test_starttimedialog.py | 38 ++++++++++++------- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/tests/functional/openlp_core_lib/test_registry.py b/tests/functional/openlp_core_lib/test_registry.py index df40ecd8e..f27eef3d8 100644 --- a/tests/functional/openlp_core_lib/test_registry.py +++ b/tests/functional/openlp_core_lib/test_registry.py @@ -30,14 +30,14 @@ class TestRegistry(TestCase): with self.assertRaises(KeyError) as context: Registry().register(u'test1', mock_1) self.assertEqual(context.exception[0], u'Duplicate service exception test1', - u'KeyError exception should have been thrown for [duplicate service|missing service|deleted service]') + u'KeyError exception should have been thrown for duplicate service') # WHEN I try to get back a non existent component # THEN I will get an exception with self.assertRaises(KeyError) as context: temp = Registry().get(u'test2') self.assertEqual(context.exception[0], u'Service test2 not found in list', - u'KeyError exception should have been thrown for [duplicate service|missing service|deleted service]') + u'KeyError exception should have been thrown for missing service') # WHEN I try to replace a component I should be allowed (testing only) Registry().remove(u'test1') @@ -45,4 +45,4 @@ class TestRegistry(TestCase): with self.assertRaises(KeyError) as context: temp = Registry().get(u'test1') self.assertEqual(context.exception[0], u'Service test1 not found in list', - u'KeyError exception should have been thrown for [duplicate service|missing service|deleted service]0') + u'KeyError exception should have been thrown for deleted service') diff --git a/tests/functional/openlp_core_ui/test_starttimedialog.py b/tests/functional/openlp_core_ui/test_starttimedialog.py index 5f6cff620..918c6637c 100644 --- a/tests/functional/openlp_core_ui/test_starttimedialog.py +++ b/tests/functional/openlp_core_ui/test_starttimedialog.py @@ -33,18 +33,28 @@ class TestStartTimeDialog(TestCase): """ Test StartTimeDialog are defaults correct """ - self.assertEqual(self.form.hourSpinBox.minimum(), 0) - self.assertEqual(self.form.hourSpinBox.maximum(), 4) - self.assertEqual(self.form.minuteSpinBox.minimum(), 0) - self.assertEqual(self.form.minuteSpinBox.maximum(), 59) - self.assertEqual(self.form.secondSpinBox.minimum(), 0) - self.assertEqual(self.form.secondSpinBox.maximum(), 59) - self.assertEqual(self.form.hourFinishSpinBox.minimum(), 0) - self.assertEqual(self.form.hourFinishSpinBox.maximum(), 4) - self.assertEqual(self.form.minuteFinishSpinBox.minimum(), 0) - self.assertEqual(self.form.minuteFinishSpinBox.maximum(), 59) - self.assertEqual(self.form.secondFinishSpinBox.minimum(), 0) - self.assertEqual(self.form.secondFinishSpinBox.maximum(), 59) + self.assertEqual(self.form.hourSpinBox.minimum(), 0, u'The minimum hour should stay the same as the dialog') + self.assertEqual(self.form.hourSpinBox.maximum(), 4, u'The maximum hour should stay the same as the dialog') + self.assertEqual(self.form.minuteSpinBox.minimum(), 0, + u'The minimum minute should stay the same as the dialog') + self.assertEqual(self.form.minuteSpinBox.maximum(), 59, + u'The maximum minute should stay the same as the dialog') + self.assertEqual(self.form.secondSpinBox.minimum(), 0, + u'The minimum second should stay the same as the dialog') + self.assertEqual(self.form.secondSpinBox.maximum(), 59, + u'The maximum second should stay the same as the dialog') + self.assertEqual(self.form.hourFinishSpinBox.minimum(), 0, + u'The minimum finish hour should stay the same as the dialog') + self.assertEqual(self.form.hourFinishSpinBox.maximum(), 4, + u'The maximum finish hour should stay the same as the dialog') + self.assertEqual(self.form.minuteFinishSpinBox.minimum(), 0, + u'The minimum finish minute should stay the same as the dialog') + self.assertEqual(self.form.minuteFinishSpinBox.maximum(), 59, + u'The maximum finish minute should stay the same as the dialog') + self.assertEqual(self.form.secondFinishSpinBox.minimum(), 0, + u'The minimum finish second should stay the same as the dialog') + self.assertEqual(self.form.secondFinishSpinBox.maximum(), 59, + u'The maximum finish second should stay the same as the dialog') def time_display_test(self): """ @@ -67,7 +77,7 @@ class TestStartTimeDialog(TestCase): self.assertEqual(self.form.hourSpinBox.value(), 0) self.assertEqual(self.form.minuteSpinBox.value(), 1) self.assertEqual(self.form.secondSpinBox.value(), 1) - self.assertEqual(self.form.item[u'service_item'].start_time, 61, u'The start time has not changed') + self.assertEqual(self.form.item[u'service_item'].start_time, 61, u'The start time should stay the same') # WHEN displaying the UI, changing the time to 2min 3secs and pressing enter self.form.item = {u'service_item': mocked_serviceitem} @@ -82,4 +92,4 @@ class TestStartTimeDialog(TestCase): self.assertEqual(self.form.hourSpinBox.value(), 0) self.assertEqual(self.form.minuteSpinBox.value(), 2) self.assertEqual(self.form.secondSpinBox.value(), 3) - self.assertEqual(self.form.item[u'service_item'].start_time, 123, u'The start time has changed') \ No newline at end of file + self.assertEqual(self.form.item[u'service_item'].start_time, 123, u'The start time should have changed') \ No newline at end of file