test_rosmsg_importlib.py 文件源码

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

项目:rosimport 作者: pyros-dev 项目源码 文件源码
def test_importlib_import_absolute_srv(self):
        # Verify that files exists and are importable
        # __import__ checks sys.modules by itself
        # but the test is not reflecting anything if we use the already loaded module.
        if sys.modules.get('std_srvs.srv'):
            #TODO : EVERYWHERE !
            raise unittest.SkipTest("module previously loaded".format('std_srvs.srv'))
        else:
            std_srvs = importlib.__import__('std_srvs.srv')
            std_srvs = std_srvs.srv

            self.assert_std_service_classes(std_srvs.SetBool, std_srvs.SetBoolRequest, std_srvs.SetBoolResponse)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号