def test_from_hex(self): self.assertRaises(AssertionError, Bus._pick_from_hex, 1, []) self.assertRaises(BusException, Bus._pick_from_hex, "", [("x",1)]) self.assertRaises(BusException, Bus._pick_from_hex, "10", []) self.assertEqual(Bus._pick_from_hex("10", [("x", 1)]), {"x":16}) self.assertEqual(Bus._pick_from_hex("100010", [("x", 1), ("y", 2)]), {"x":16, "y":16})