예제 #1
0
 def setAttr(self, device, outputAttr, value, pendingOut):
     output, index = self.outputMap[(device, outputAttr)]
     outList = pendingOut[output]
     setListElem(outList, index, value, combine=max)
예제 #2
0
파일: output_test.py 프로젝트: drewp/light9
 def testSetExisting(self):
     x = [0, 1]
     setListElem(x, 0, 9)
     self.assertEqual([9, 1], x)
예제 #3
0
파일: output_test.py 프로젝트: drewp/light9
 def testSetNext(self):
     x = [0, 1]
     setListElem(x, 2, 9)
     self.assertEqual([0, 1, 9], x)
예제 #4
0
파일: output_test.py 프로젝트: drewp/light9
 def testCombineHasNoEffectOnNewElems(self):
     x = [0, 1]
     setListElem(x, 2, 1, combine=max)
     self.assertEqual([0, 1, 1], x)
예제 #5
0
파일: output_test.py 프로젝트: drewp/light9
 def testCombineMax(self):
     x = [0, 1]
     setListElem(x, 1, 0, combine=max)
     self.assertEqual([0, 1], x)
예제 #6
0
파일: output_test.py 프로젝트: drewp/light9
 def testSetZero(self):
     x = [0, 1]
     setListElem(x, 5, 0)
     self.assertEqual([0, 1, 0, 0, 0, 0], x)
예제 #7
0
파일: output_test.py 프로젝트: drewp/light9
 def testArbitraryFill(self):
     x = [0, 1]
     setListElem(x, 5, 9, fill=8)
     self.assertEqual([0, 1, 8, 8, 8, 9], x)
예제 #8
0
파일: output_test.py 프로젝트: drewp/light9
 def testSetBeyond(self):
     x = [0, 1]
     setListElem(x, 3, 9)
     self.assertEqual([0, 1, 0, 9], x)