test_settings_dict.py 文件源码

python
阅读 39 收藏 0 点赞 0 评论 0

项目:Jackal_Velodyne_Duke 作者: MengGuo 项目源码 文件源码
def test_init_sets_the_correct_attrs(self):
        """__init__ sets the fields that get_settings reads"""
        for setting, value in (
                ('baudrate', 57600),
                ('timeout', 7),
                ('write_timeout', 12),
                ('inter_byte_timeout', 15),
                ('stopbits', serial.STOPBITS_TWO),
                ('bytesize', serial.SEVENBITS),
                ('parity', serial.PARITY_ODD),
                ('xonxoff', True),
                ('rtscts', True),
                ('dsrdtr', True)):
            kwargs = {'do_not_open': True, setting: value}
            ser = serial.serial_for_url(PORT, **kwargs)
            d = ser.get_settings()
            self.assertEqual(getattr(ser, setting), value)
            self.assertEqual(d[setting], value)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号