示例#1
0
 def test_not_external_function_requested(self):
     assert _parse_external(function_for_testing, function=True) == function_for_testing
示例#2
0
 def test_not_external_string(self):
     assert _parse_external('normal string') == 'normal string'
示例#3
0
 def test_not_external_function(self):
     assert _parse_external(function_for_testing) == function_for_testing
示例#4
0
 def test_invalid_functions(self, value, message):
     with pytest.raises(ValueError) as exc:
         _parse_external(value, function=True)
     assert re.search(message.format('a function'), exc.value.args[0])
示例#5
0
 def test_both_explicit_and_external_function(self):
     import itertools
     assert _parse_external('ext://itertools.chain', function=True) == itertools.chain
示例#6
0
 def test_external_function(self):
     import itertools
     assert _parse_external('itertools.chain', function=True) == itertools.chain
示例#7
0
 def test_explicit_external_function(self):
     import itertools
     assert _parse_external('ext://itertools.chain') == itertools.chain
示例#8
0
 def test_explicit_external_attribute(self):
     assert _parse_external('ext://sys.stdin') == sys.stdin