Tino de Bruijn avatar Tino de Bruijn committed 39a9bf1

Fixed tests and adapted mockup to new layout argument

Comments (0)

Files changed (2)


 class MockupBoard(pyfirmata.Board):
-    def __init__(self, port='', type="arduino", values_dict={}):
+    def __init__(self, port, layout, values_dict={}):
         self.sp = MockupSerial(port, 57600)
-        self.setup_layout(pyfirmata.BOARDS[type])
+        self.setup_layout(layout)
         self.values_dict = values_dict
         self.id = 1
     def setUp(self):
         # Test with the MockupSerial so no real connection is needed
         pyfirmata.pyfirmata.serial.Serial = mockup.MockupSerial
-        self.board = pyfirmata.Board('')
+        self.board = pyfirmata.Board('', BOARDS['arduino'])
         self.board._stored_data = [] # FIXME How can it be that a fresh instance sometimes still contains data?
 class TestBoardMessages(BoardBaseTest):
     def setUp(self):
-        self.board = mockup.MockupBoard('test')
+        self.board = mockup.MockupBoard('test', BOARDS['arduino'])
 board_messages = unittest.TestLoader().loadTestsFromTestCase(TestBoardMessages)
 board_layout = unittest.TestLoader().loadTestsFromTestCase(TestBoardLayout)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.