~thelinuxguy/openlp/bible-improvements

« back to all changes in this revision

Viewing changes to tests/interfaces/openlp_core/ui/test_starttimedialog.py

  • Committer: Tim Bentley
  • Date: 2017-12-24 07:27:40 UTC
  • mfrom: (2792.1.47 fixes)
  • Revision ID: tim.bentley@gmail.com-20171224072740-6vxvu19b4uenr501
All tests migrated to assert from self.assert except projection
All tests pass on linux with pytest and nose2

lp:~trb143/openlp/asserts2 (revision 2839)
https://ci.openlp.io/job/Branch-01-Pull/2381/                          [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2282/                  [SUCCESS]
  File "./scripts/jenkins_script.py", line 256, in <module>
    main()
  File "./scripts/jenkins_script.py", line 252, in main
    jenkins_trigger.print_output(can_continue=args.alw...

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
        """
57
57
        Test StartTimeDialog are defaults correct
58
58
        """
59
 
        self.assertEqual(self.form.hour_spin_box.minimum(), 0, 'The minimum hour should stay the same as the dialog')
60
 
        self.assertEqual(self.form.hour_spin_box.maximum(), 4, 'The maximum hour should stay the same as the dialog')
61
 
        self.assertEqual(self.form.minute_spin_box.minimum(), 0,
62
 
                         'The minimum minute should stay the same as the dialog')
63
 
        self.assertEqual(self.form.minute_spin_box.maximum(), 59,
64
 
                         'The maximum minute should stay the same as the dialog')
65
 
        self.assertEqual(self.form.second_spin_box.minimum(), 0,
66
 
                         'The minimum second should stay the same as the dialog')
67
 
        self.assertEqual(self.form.second_spin_box.maximum(), 59,
68
 
                         'The maximum second should stay the same as the dialog')
69
 
        self.assertEqual(self.form.hour_finish_spin_box.minimum(), 0,
70
 
                         'The minimum finish hour should stay the same as the dialog')
71
 
        self.assertEqual(self.form.hour_finish_spin_box.maximum(), 4,
72
 
                         'The maximum finish hour should stay the same as the dialog')
73
 
        self.assertEqual(self.form.minute_finish_spin_box.minimum(), 0,
74
 
                         'The minimum finish minute should stay the same as the dialog')
75
 
        self.assertEqual(self.form.minute_finish_spin_box.maximum(), 59,
76
 
                         'The maximum finish minute should stay the same as the dialog')
77
 
        self.assertEqual(self.form.second_finish_spin_box.minimum(), 0,
78
 
                         'The minimum finish second should stay the same as the dialog')
79
 
        self.assertEqual(self.form.second_finish_spin_box.maximum(), 59,
80
 
                         'The maximum finish second should stay the same as the dialog')
 
59
        assert self.form.hour_spin_box.minimum() == 0, 'The minimum hour should stay the same as the dialog'
 
60
        assert self.form.hour_spin_box.maximum() == 4, 'The maximum hour should stay the same as the dialog'
 
61
        assert self.form.minute_spin_box.minimum() == 0, 'The minimum minute should stay the same as the dialog'
 
62
        assert self.form.minute_spin_box.maximum() == 59, 'The maximum minute should stay the same as the dialog'
 
63
        assert self.form.second_spin_box.minimum() == 0, 'The minimum second should stay the same as the dialog'
 
64
        assert self.form.second_spin_box.maximum() == 59, 'The maximum second should stay the same as the dialog'
 
65
        assert self.form.hour_finish_spin_box.minimum() == 0, \
 
66
            'The minimum finish hour should stay the same as the dialog'
 
67
        assert self.form.hour_finish_spin_box.maximum() == 4, \
 
68
            'The maximum finish hour should stay the same as the dialog'
 
69
        assert self.form.minute_finish_spin_box.minimum() == 0, \
 
70
            'The minimum finish minute should stay the same as the dialog'
 
71
        assert self.form.minute_finish_spin_box.maximum() == 59, \
 
72
            'The maximum finish minute should stay the same as the dialog'
 
73
        assert self.form.second_finish_spin_box.minimum() == 0, \
 
74
            'The minimum finish second should stay the same as the dialog'
 
75
        assert self.form.second_finish_spin_box.maximum() == 59, \
 
76
            'The maximum finish second should stay the same as the dialog'
81
77
 
82
78
    def test_time_display(self):
83
79
        """
97
93
        QtTest.QTest.mouseClick(ok_widget, QtCore.Qt.LeftButton)
98
94
 
99
95
        # THEN the following input values are returned
100
 
        self.assertEqual(self.form.hour_spin_box.value(), 0)
101
 
        self.assertEqual(self.form.minute_spin_box.value(), 1)
102
 
        self.assertEqual(self.form.second_spin_box.value(), 1)
103
 
        self.assertEqual(self.form.item['service_item'].start_time, 61, 'The start time should stay the same')
 
96
        assert self.form.hour_spin_box.value() == 0
 
97
        assert self.form.minute_spin_box.value() == 1
 
98
        assert self.form.second_spin_box.value() == 1
 
99
        assert self.form.item['service_item'].start_time == 61, 'The start time should stay the same'
104
100
 
105
101
        # WHEN displaying the UI, changing the time to 2min 3secs and pressing enter
106
102
        self.form.item = {'service_item': mocked_serviceitem}
112
108
        QtTest.QTest.mouseClick(ok_widget, QtCore.Qt.LeftButton)
113
109
 
114
110
        # THEN the following values are returned
115
 
        self.assertEqual(self.form.hour_spin_box.value(), 0)
116
 
        self.assertEqual(self.form.minute_spin_box.value(), 2)
117
 
        self.assertEqual(self.form.second_spin_box.value(), 3)
118
 
        self.assertEqual(self.form.item['service_item'].start_time, 123, 'The start time should have changed')
 
111
        assert self.form.hour_spin_box.value() == 0
 
112
        assert self.form.minute_spin_box.value() == 2
 
113
        assert self.form.second_spin_box.value() == 3
 
114
        assert self.form.item['service_item'].start_time == 123, 'The start time should have changed'