~thelinuxguy/openlp/bible-improvements

« back to all changes in this revision

Viewing changes to tests/functional/openlp_core/common/test_mixins.py

  • Committer: Tim Bentley
  • Date: 2017-12-17 14:02:03 UTC
  • mfrom: (2792.1.17 fixes)
  • Revision ID: tim.bentley@gmail.com-20171217140203-k9fg0sv6of9qinjd
Refactor asserts in api and common packages

lp:~trb143/openlp/asserts (revision 2809)
https://ci.openlp.io/job/Branch-01-Pull/2354/                          [SUCCESS]
https://ci.openlp.io/job/Branch-02-Functional-Tests/2255/              [SUCCESS]
https://ci.openlp.io/job/Branch-03-Interface-Tests/2120/               [SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code_Analysis/1446/                [SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test_Coverage/1263/                [SUCCESS]
https...

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
        # GIVEN an Empty Registry
47
47
        # WHEN there is no Application
48
48
        # THEN the application should be none
49
 
        self.assertEqual(self.application, None, 'The application value should be None')
 
49
        assert self.application is None, 'The application value should be None'
50
50
 
51
51
    def test_application(self):
52
52
        """
59
59
        Registry().register('application', application)
60
60
 
61
61
        # THEN the application should be none
62
 
        self.assertEqual(self.application, application, 'The application value should match')
 
62
        assert self.application == application, 'The application value should match'
63
63
 
64
64
    @patch('openlp.core.common.mixins.is_win')
65
65
    def test_application_on_windows(self, mocked_is_win):
74
74
        Registry().register('application', application)
75
75
 
76
76
        # THEN the application should be none
77
 
        self.assertEqual(self.application, application, 'The application value should match')
 
77
        assert self.application == application, 'The application value should match'
78
78
 
79
79
    @patch('openlp.core.common.mixins.is_win')
80
80
    def test_get_application_on_windows(self, mocked_is_win):
93
93
            actual_application = reg_props.application
94
94
 
95
95
        # THEN the application should be the mock object, and the correct function should have been called
96
 
        self.assertEqual(mock_application, actual_application, 'The application value should match')
 
96
        assert mock_application == actual_application, 'The application value should match'
97
97
        mocked_is_win.assert_called_with()
98
98
        mocked_get.assert_called_with('application')