class TestCLI(unittest.TestCase): def setUp(self): self.rig = createSampleRig() self.show = Show(self.rig) self.parser = CLI(self.show) def tearDown(self): self.interface = None self.uni = None def testSingleChannel(self): self.parser.parseLine("1@128") self.show.refresh() self.assertEqual(self.rig.outputs[0].channels[0], 128) for i in range(1, 256): self.assertEqual(self.rig.outputs[0].channels[i], 0, "Channel %s set incorrectly" % (i + 1)) def testMultipleChannels(self): self.parser.parseLine("1-10@176") self.show.refresh() for i in range(0, 10): self.assertEqual(self.rig.outputs[0].channels[i], 176, "Channel %s not set correctly" % (i + 1)) for i in range(10, 256): self.assertEqual(self.rig.outputs[0].channels[i], 0, "Channel %s set incorrectly" % (i + 1)) def testState(self): for i in range(1, 25): self.parser.parseLine("{0}@{1:00}".format(i, i * 10)) self.parser.parseLine("save") self.parser.parseLine("1-24@00") self.show.refresh() self.parser.parseLine("restore 1") self.show.refresh() for i in range(1, 25): self.assertEqual(self.rig.outputs[0].channels[i - 1], i * 10, "Channel %s not restored" % (i + 1))
class TestCLI(unittest.TestCase): def setUp(self): self.rig = createSampleRig() self.show = Show(self.rig) self.parser = CLI(self.show) def tearDown(self): self.interface = None self.uni = None def testSingleChannel(self): self.parser.parseLine("1@128") self.show.refresh() self.assertEqual(self.rig.outputs[0].channels[0], 128) for i in range(1,256): self.assertEqual(self.rig.outputs[0].channels[i], 0, "Channel %s set incorrectly" % (i + 1)) def testMultipleChannels(self): self.parser.parseLine("1-10@176") self.show.refresh() for i in range(0,10): self.assertEqual(self.rig.outputs[0].channels[i], 176, "Channel %s not set correctly" % (i + 1)) for i in range(10, 256): self.assertEqual(self.rig.outputs[0].channels[i], 0, "Channel %s set incorrectly" % (i + 1)) def testState(self): for i in range(1, 25): self.parser.parseLine("{0}@{1:00}".format(i, i * 10)) self.parser.parseLine("save") self.parser.parseLine("1-24@00") self.show.refresh() self.parser.parseLine("restore 1") self.show.refresh() for i in range(1, 25): self.assertEqual(self.rig.outputs[0].channels[i - 1], i * 10, "Channel %s not restored" % (i + 1))
from console import Rig, Show from console.heads import Dimmer from interface import Terminal from console import fx from artnet import ArtNetSender from twisted.internet import reactor r = Rig() show = Show(r) for i in range(1, 9): d = Dimmer(1, i) r.heads[i] = d f = fx.IntensityRamp() show.programmer.add_fx(range(1, 9), f) show.run() artnet = ArtNetSender(r.outputs[0]) reactor.listenUDP(6454, artnet) reactor.run() interface = Terminal(show) interface.start()
def setUp(self): self.rig = createSampleRig() self.show = Show(self.rig) self.parser = CLI(self.show)