Пример #1
0
    def test_notice(self):
        mock = mymocksubprocess()
        n = NoticeLogic()

        n.play_sound_warranted(29)
        assert mock.ccall != None
        assert mock.ccall[1] == NOTICE_SOUND
Пример #2
0
 def test_normal(self):
     mock = mymocksubprocess()
     mock2 = mymocksubprocess()
     n = NoticeLogic()
     n.subprocess = mock2
     n.play_sound_warranted(31)
     assert mock2.ccall == None
Пример #3
0
    def test_emergency(self):
        mock = mymocksubprocess()
        n = NoticeLogic()
        NoticeLogic._emergency_power_flag = False

        n.play_sound_warranted(9)
        assert n._emergency_power_flag == True
        assert mock.pccall != None
        assert mock.pccall[1] == EMERGENCY_POWER_SOUND

        assert mock.ccall != None
        assert mock.ccall[1] == NOTICE_SOUND