本文整理匯總了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