test: verify switchbot cast speed selection and document probe interference
This commit is contained in:
@@ -18,6 +18,7 @@ class Widget(object):
|
||||
def __getattr__(self,name):
|
||||
if name.startswith('__'):raise AttributeError(name)
|
||||
return lambda *a,**k:0
|
||||
def __del__(self):pass
|
||||
def Show(self):self.shown=True
|
||||
def Hide(self):self.shown=False
|
||||
def IsShow(self):return self.shown
|
||||
@@ -104,6 +105,19 @@ class SwitchbotTests(unittest.TestCase):
|
||||
self.assertEqual(self.mods['constInfo'].USERDATA_DIRECTORY,'')
|
||||
self.assertEqual(self.ns['ITEM_TAB_WIDTH'],(400-16)/5+1-2) # 5 tabs: cell 5 is hidden, as in AVA2
|
||||
|
||||
def test_cast_speed_selection_preserves_attribute_id(self):
|
||||
sent=[]
|
||||
sb=self.mods['switchbot']
|
||||
sb.GetAttributeMaxValue=lambda slot,kind:20
|
||||
sb.SetAttribute=lambda *args:sent.append(args)
|
||||
window=self.ns['SwitchbotWindow'].__new__(self.ns['SwitchbotWindow'])
|
||||
window.selectedSlot=0;window.alternative=0;window.attrSearchIdx=0
|
||||
row=Widget();row.SetAttribute=lambda label,value:None
|
||||
window.attrDict={0:row}
|
||||
window._SwitchbotWindow__RefreshButtons=lambda:None
|
||||
window._SwitchbotWindow__OnAcceptSearch(9,'cast speed')
|
||||
self.assertEqual(sent,[(0,0,0,9,20)])
|
||||
|
||||
def test_server_messages(self):
|
||||
game=self.mods['game'].GameWindow()
|
||||
for line in ('switchbot_end 2','switchbot_stop noattr 1','switchbot_stop nochanger 0','switchbot_error active',
|
||||
|
||||
Reference in New Issue
Block a user