From 63fda0a231017870a0c11349d2d07658593ca64e Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Wed, 27 Jan 2016 00:08:31 +0000 Subject: [PATCH] tests: gadget0: config should be 0 in addressed state --- tests/gadget-zero/test_gadget0.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/gadget-zero/test_gadget0.py b/tests/gadget-zero/test_gadget0.py index 4a14ec9a..a27d5f40 100644 --- a/tests/gadget-zero/test_gadget0.py +++ b/tests/gadget-zero/test_gadget0.py @@ -49,6 +49,12 @@ class TestGadget0(unittest.TestCase): """ self.dev.set_configuration(3) + def test_config_zero_addressed(self): + self.dev.set_configuration(0) + x = self.dev.ctrl_transfer(0x80, 0x08, 0, 0, 1) + self.assertEqual(0, x[0], "Should be configuration 0 before configuration is set") + + def test_fetch_config(self): self.dev.set_configuration(3) # FIXME - find a way to get the defines for these from pyusb