本文整理汇总了Python中aql.options.Options.env['PATH']方法的典型用法代码示例。如果您正苦于以下问题:Python Options.env['PATH']方法的具体用法?Python Options.env['PATH']怎么用?Python Options.env['PATH']使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aql.options.Options
的用法示例。
在下文中一共展示了Options.env['PATH']方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_options_dict
# 需要导入模块: from aql.options import Options [as 别名]
# 或者: from aql.options.Options import env['PATH'] [as 别名]
def test_options_dict(self):
options = Options()
options.cxx = PathOptionType()
options.debug_on = BoolOptionType()
options.defines = DictOptionType(key_type=str, value_type=str)
options.env = DictOptionType(key_type=UpperCaseString)
options.env['PATH'] = ListOptionType(
value_type=FilePath, separators=os.pathsep)
options.env['PATH'] = []
options.env['Include'] = list
options.env['HOME'] = FilePath()
options.env['Path'] = '/work/bin'
options.env['Include'] = '/work/bin'
self.assertEqual(options.env['path'].get(), '/work/bin')
self.assertEqual(options.env['Include'].get(), '/work/bin')
options.env['Path'] = options.env['Path'] + ['/usr/bin']
options.env['path'] += ['/usr/local/bin', '/home/user/bin']
options.env['Home'] = '/home/user'
options.env['path'] += options.env['Home']
options.env['path'] += options.cxx
options.cxx = '/mingw/bin/g++'
options.If().debug_on.eq(False).defines['DEBUG'] = 'FALSE'
options.If().debug_on.eq(True).defines['DEBUG'] = 'TRUE'
options.defines['OPTS'] = ''
options.If().defines['DEBUG'].eq(
'TRUE').defines['OPTS'] += options.defines['DEBUG']
path = list(map(FilePath, ['/work/bin', '/usr/bin', '/usr/local/bin',
'/home/user/bin', '/home/user',
'/mingw/bin/g++']))
value = options.env
self.assertEqual(value['path'].get(), path)
self.assertEqual(options.defines['OPTS'], '')
options.debug_on = True
self.assertEqual(options.defines['OPTS'], 'TRUE')