~thelinuxguy/openlp/bible-improvements

« back to all changes in this revision

Viewing changes to tests/interfaces/openlp_core/widgets/test_edits.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:
86
86
 
87
87
        # THEN: The first search type should be the first one in the list. The selected type should be saved in the
88
88
        #       settings
89
 
        self.assertEqual(self.search_edit.current_search_type(), SearchTypes.First,
90
 
                         "The first search type should be selected.")
 
89
        assert self.search_edit.current_search_type() == SearchTypes.First, \
 
90
            "The first search type should be selected."
91
91
        self.mocked_settings().setValue.assert_called_once_with('settings_section/last used search type', 0)
92
92
 
93
93
    def test_set_current_search_type(self):
99
99
        result = self.search_edit.set_current_search_type(SearchTypes.Second)
100
100
 
101
101
        # THEN:
102
 
        self.assertTrue(result, "The call should return success (True).")
103
 
        self.assertEqual(self.search_edit.current_search_type(), SearchTypes.Second,
104
 
                         "The search type should be SearchTypes.Second")
105
 
        self.assertEqual(self.search_edit.placeholderText(), SECOND_PLACEHOLDER_TEXT,
106
 
                         "The correct placeholder text should be 'Second Placeholder Text'.")
 
102
        assert result is True, "The call should return success (True)."
 
103
        assert self.search_edit.current_search_type() == SearchTypes.Second, \
 
104
            "The search type should be SearchTypes.Second"
 
105
        assert self.search_edit.placeholderText() == SECOND_PLACEHOLDER_TEXT, \
 
106
            "The correct placeholder text should be 'Second Placeholder Text'."
107
107
        self.mocked_settings().setValue.assert_has_calls(
108
108
            [call('settings_section/last used search type', 0), call('settings_section/last used search type', 1)])
109
109
 
166
166
        self.combo.addItem('test2')
167
167
 
168
168
        # THEN: The list of items should contain both strings.
169
 
        self.assertEqual(self.combo.getItems(), ['test1', 'test2'])
 
169
        assert self.combo.getItems() == ['test1', 'test2']