mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-09-05 01:10:12 +02:00
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73322 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
55 lines
1.5 KiB
Python
55 lines
1.5 KiB
Python
import imp_unittest, unittest
|
|
import wtc
|
|
import wx
|
|
import random
|
|
|
|
import wx.lib.agw.peakmeter as PM
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
class lib_agw_peakmeter_Tests(wtc.WidgetTestCase):
|
|
|
|
def get_data(self):
|
|
arrayData = []
|
|
for i in range(15):
|
|
nRandom = random.randint(0, 100)
|
|
arrayData.append(nRandom)
|
|
|
|
return arrayData
|
|
|
|
def test_lib_agw_peakmeterCtor(self):
|
|
peak = PM.PeakMeterCtrl(self.frame, -1, style=wx.SIMPLE_BORDER, agwStyle=PM.PM_VERTICAL)
|
|
peak.SetMeterBands(10, 15)
|
|
peak.SetRangeValue(1, 10, 20)
|
|
|
|
peak.SetData(self.get_data(), 0, 15)
|
|
|
|
|
|
def test_lib_agw_peakmeterMethods(self):
|
|
peak = PM.PeakMeterCtrl(self.frame, -1, style=wx.SIMPLE_BORDER, agwStyle=PM.PM_HORIZONTAL)
|
|
peak.SetMeterBands(10, 15)
|
|
peak.SetRangeValue(1, 10, 20)
|
|
|
|
peak.SetData(self.get_data(), 0, 15)
|
|
|
|
self.assertTrue(peak.GetFalloffEffect())
|
|
self.assertTrue(not peak.IsGridVisible())
|
|
self.assertTrue(peak.GetAGWWindowStyleFlag() & PM.PM_HORIZONTAL == 0)
|
|
|
|
self.assertEqual(peak.GetRangeValue(), (1, 10, 20))
|
|
|
|
def test_lib_agw_peakmeterConstantsExist(self):
|
|
PM.BAND_DEFAULT
|
|
PM.BAND_PERCENT
|
|
PM.DEFAULT_SPEED
|
|
PM.FALL_INCREASEBY
|
|
PM.GRID_INCREASEBY
|
|
PM.LEDS_DEFAULT
|
|
PM.PM_HORIZONTAL
|
|
PM.PM_VERTICAL
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|