~trb143/openlp/media_timer2

« back to all changes in this revision

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

  • Committer: Tim Bentley
  • Date: 2016-04-06 05:08:44 UTC
  • mfrom: (2619.2.19 trunk)
  • Revision ID: tim.bentley@gmail.com-20160406050844-dt24kf7e5enu6rdr
Head

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)