本文整理汇总了Python中pex.variables.Variables._get_int方法的典型用法代码示例。如果您正苦于以下问题:Python Variables._get_int方法的具体用法?Python Variables._get_int怎么用?Python Variables._get_int使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pex.variables.Variables
的用法示例。
在下文中一共展示了Variables._get_int方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_pex_vars_set
# 需要导入模块: from pex.variables import Variables [as 别名]
# 或者: from pex.variables.Variables import _get_int [as 别名]
def test_pex_vars_set():
v = Variables(environ={})
v.set('HELLO', '42')
assert v._get_int('HELLO') == 42
v.delete('HELLO')
assert v._get_int('HELLO') is None
assert {} == v.copy()
示例2: test_pexrc_precedence
# 需要导入模块: from pex.variables import Variables [as 别名]
# 或者: from pex.variables.Variables import _get_int [as 别名]
def test_pexrc_precedence():
with named_temporary_file(mode='w') as pexrc:
pexrc.write('HELLO=FORTYTWO')
pexrc.flush()
v = Variables(rc=pexrc.name, environ={'HELLO': 42})
assert v._get_int('HELLO') == 42
示例3: test_pex_from_rc
# 需要导入模块: from pex.variables import Variables [as 别名]
# 或者: from pex.variables.Variables import _get_int [as 别名]
def test_pex_from_rc():
with named_temporary_file(mode='w') as pexrc:
pexrc.write('HELLO=42')
pexrc.flush()
v = Variables(rc=pexrc.name)
assert v._get_int('HELLO') == 42
示例4: test_pexrc_precedence
# 需要导入模块: from pex.variables import Variables [as 别名]
# 或者: from pex.variables.Variables import _get_int [as 别名]
def test_pexrc_precedence():
with tempfile.NamedTemporaryFile(mode="w") as pexrc:
pexrc.write("HELLO=FORTYTWO")
pexrc.flush()
v = Variables(environ={"HELLO": 42}, rc=pexrc.name)
assert v._get_int("HELLO") == 42
示例5: test_pex_from_rc
# 需要导入模块: from pex.variables import Variables [as 别名]
# 或者: from pex.variables.Variables import _get_int [as 别名]
def test_pex_from_rc():
with tempfile.NamedTemporaryFile(mode="w") as pexrc:
pexrc.write("HELLO=42")
pexrc.flush()
v = Variables(rc=pexrc.name)
assert v._get_int("HELLO") == 42
示例6: test_pex_vars_set
# 需要导入模块: from pex.variables import Variables [as 别名]
# 或者: from pex.variables.Variables import _get_int [as 别名]
def test_pex_vars_set():
v = Variables(environ={})
v.set("HELLO", "42")
assert v._get_int("HELLO") == 42
v.delete("HELLO")
assert v._get_int("HELLO") is None