~tomasgroth/openlp/25bugfixes2

« back to all changes in this revision

Viewing changes to tests/functional/openlp_plugins/songusage/test_songusage.py

  • Committer: Tomas Groth
  • Author(s): tomasgroth at yahoo
  • Date: 2016-02-29 20:57:10 UTC
  • mfrom: (2622.2.2 refix-win-display)
  • Revision ID: tomasgroth@yahoo.dk-20160229205710-6gv1h988rlvm6i1j
Another attempt to fully fix bug 1531319.

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
 
82
82
        # THEN: It should return True
83
83
        self.assertTrue(ret)
 
84
 
 
85
    @patch('openlp.plugins.songusage.songusageplugin.Manager')
 
86
    def toggle_song_usage_state_test(self, MockedManager):
 
87
        """
 
88
        Test that toggle_song_usage_state does toggle song_usage_state
 
89
        """
 
90
        # GIVEN: A SongUsagePlugin
 
91
        song_usage = SongUsagePlugin()
 
92
        song_usage.set_button_state = MagicMock()
 
93
        song_usage.song_usage_active = True
 
94
 
 
95
        # WHEN: calling toggle_song_usage_state
 
96
        song_usage.toggle_song_usage_state()
 
97
 
 
98
        # THEN: song_usage_state should have been toogled
 
99
        self.assertFalse(song_usage.song_usage_active)