def setUp(self): self.path = os.path.join(layoutPath, layoutFile) self.layout = Layout.createFromExisting(self.path) self.layoutserver = LayoutServer.createFromExisting( self.path, "Test Server", 10030) self.layoutserver.run() self.conn = httplib.HTTPConnection("localhost:10030")
def setUp(self): self.name = rospy.get_param('~name', 'OSC Server') self.port = int(rospy.get_param('~port', '9658')) self.file = rospy.get_param('~layout_file', rospy.get_param('layout_file', None)) self.layout = Layout.createFromExisting(self.file) self.clients = {}
def test_allcontrols(self): l = Layout.createEmpty() tp = Tabpage() tp.name = "Demo" tp.append(controls.control_factory("led","led", color=self.randColor(), x=0, y=0)) tp.append(controls.control_factory("labelv","labelv", color=self.randColor(), x=100, y=0)) tp.append(controls.control_factory("labelh","labelh", color=self.randColor(), x=200, y=0)) tp.append(controls.control_factory("push", "push", color=self.randColor(), x=300, y=0)) tp.append(controls.control_factory("toggle", "toggle", color=self.randColor(), x=400, y=0)) tp.append(controls.control_factory("xy", "xy", color=self.randColor(), x=500, y=0, width=200, height=200)) tp.append(controls.control_factory("faderv","faderv", color=self.randColor(), x=0, y=100)) tp.append(controls.control_factory("faderh","faderh", color=self.randColor(), x=100, y=100)) tp.append(controls.control_factory("rotaryv","rotaryv", color=self.randColor(), x=200, y=100)) tp.append(controls.control_factory("rotaryh","rotaryh", color=self.randColor(), x=300, y=100)) tp.append(controls.control_factory("encoder", "encoder", color=self.randColor(), x=400, y=100)) tp.append(controls.control_factory("batteryv","batteryv", color=self.randColor(), x=0, y=200)) tp.append(controls.control_factory("batteryh","batteryh", color=self.randColor(), x=100, y=200)) tp.append(controls.control_factory("timev","timev", color=self.randColor(), x=200, y=200)) tp.append(controls.control_factory("timeh","timeh", color=self.randColor(), x=300, y=200)) tp.append(controls.control_factory("multipush", "multipush", color=self.randColor(), x=0, y=300, width=300, height=300)) tp.append(controls.control_factory("multitoggle", "multitoggle", color=self.randColor(), x=300, y=300, width=300, height=300)) tp.append(controls.control_factory("multifaderh", "multifaderh", color=self.randColor(), x=0, y=600, width=300, height=300)) tp.append(controls.control_factory("multifaderv", "multifaderv", color=self.randColor(), x=300, y=600, width=300, height=300)) tp.append(controls.control_factory("multixy", "multixy", color=self.randColor(), x=600, y=300, height=600, width=150)) l.addTabpage(tp) l.writeToFile("/home/mjcarroll", "Demo.touchosc", True)
def setUp(self): self.path = os.path.join(layoutPath, layoutFile) self.layout = Layout.createFromExisting(self.path) self.layoutserver = LayoutServer.createFromExisting(self.path, "Test Server", 10030) self.layoutserver.run() self.conn = httplib.HTTPConnection("localhost:10030")
def setUp(self): self.layoutFile = layoutFile self.layoutPath = layoutPath self.layoutJoinPath = os.path.join(self.layoutPath, self.layoutFile) self.layout = Layout.createFromExisting(self.layoutJoinPath) self.testFile = 'test' self.testFileExt = 'test.touchosc' self.testPath = layoutPath self.testJoinPath = os.path.join(self.testPath, self.testFileExt)
def setUp(self): self.path = os.path.join(layoutPath, layoutFile) self.layout = Layout.createFromExisting(self.path)
def test_allcontrols(self): l = Layout.createEmpty() tp = Tabpage() tp.name = "Demo" tp.append( controls.control_factory("led", "led", color=self.randColor(), x=0, y=0)) tp.append( controls.control_factory("labelv", "labelv", color=self.randColor(), x=100, y=0)) tp.append( controls.control_factory("labelh", "labelh", color=self.randColor(), x=200, y=0)) tp.append( controls.control_factory("push", "push", color=self.randColor(), x=300, y=0)) tp.append( controls.control_factory("toggle", "toggle", color=self.randColor(), x=400, y=0)) tp.append( controls.control_factory("xy", "xy", color=self.randColor(), x=500, y=0, width=200, height=200)) tp.append( controls.control_factory("faderv", "faderv", color=self.randColor(), x=0, y=100)) tp.append( controls.control_factory("faderh", "faderh", color=self.randColor(), x=100, y=100)) tp.append( controls.control_factory("rotaryv", "rotaryv", color=self.randColor(), x=200, y=100)) tp.append( controls.control_factory("rotaryh", "rotaryh", color=self.randColor(), x=300, y=100)) tp.append( controls.control_factory("encoder", "encoder", color=self.randColor(), x=400, y=100)) tp.append( controls.control_factory("batteryv", "batteryv", color=self.randColor(), x=0, y=200)) tp.append( controls.control_factory("batteryh", "batteryh", color=self.randColor(), x=100, y=200)) tp.append( controls.control_factory("timev", "timev", color=self.randColor(), x=200, y=200)) tp.append( controls.control_factory("timeh", "timeh", color=self.randColor(), x=300, y=200)) tp.append( controls.control_factory("multipush", "multipush", color=self.randColor(), x=0, y=300, width=300, height=300)) tp.append( controls.control_factory("multitoggle", "multitoggle", color=self.randColor(), x=300, y=300, width=300, height=300)) tp.append( controls.control_factory("multifaderh", "multifaderh", color=self.randColor(), x=0, y=600, width=300, height=300)) tp.append( controls.control_factory("multifaderv", "multifaderv", color=self.randColor(), x=300, y=600, width=300, height=300)) tp.append( controls.control_factory("multixy", "multixy", color=self.randColor(), x=600, y=300, height=600, width=150)) l.addTabpage(tp) l.writeToFile("/home/mjcarroll", "Demo.touchosc", True)
import unittest import os import sys sys.path.append(os.path.abspath('../src')) import pytouchosc.utilities from pytouchosc.layout import Layout layout_path = os.path.abspath('./layouts') layout_ipod_h = Layout.createFromExisting(os.path.join(layout_path, 'test_ipod_h.touchosc')) layout_ipod_v = Layout.createFromExisting(os.path.join(layout_path, 'test_ipod_v.touchosc')) layout_ipad_h = Layout.createFromExisting(os.path.join(layout_path, 'test_ipad_h.touchosc')) layout_ipad_v = Layout.createFromExisting(os.path.join(layout_path, 'test_ipad_v.touchosc')) layout_five_tabpages = Layout.createFromExisting(os.path.join(layout_path, 'test_five_tabpages.touchosc')) merge = pytouchosc.utilities.merge_layouts class TestUtilities_MergeLayouts(unittest.TestCase): def setUp(self): pass def testWithWrongInput_NonList(self): with self.assertRaises(ValueError) as cm: merge(1.0) self.assertEqual(cm.exception.message, "Input argument layouts is not a list.") def testWithWrongInput_ListWithoutTabpages(self): with self.assertRaises(ValueError) as cm: