コード例 #1
0
ファイル: test_scripts.py プロジェクト: pombredanne/pip-run
 def test_index_url(self):
     script = textwrap.dedent('''
         __requires__ = ['foo']
         __index_url__ = 'https://my.private.index/'
         ''')
     reqs = scripts.DepsReader(script).read()
     assert reqs.index_url == 'https://my.private.index/'
コード例 #2
0
ファイル: test_scripts.py プロジェクト: pombredanne/pip-run
 def test_dependency_links(self):
     script = textwrap.dedent('''
         __requires__ = ['foo==0.42']
         __dependency_links__ = ['git+ssh://[email protected]/repo.git#egg=foo-0.42']
         ''')
     reqs = scripts.DepsReader(script).read()
     assert reqs.dependency_links == [
         'git+ssh://[email protected]/repo.git#egg=foo-0.42'
     ]
コード例 #3
0
ファイル: test_scripts.py プロジェクト: pombredanne/pip-run
 def test_fstrings_allowed(self):
     """
     It should be possible to read dependencies from a script
     with f-strings on all Pythons.
     """
     script = textwrap.dedent('''
         # coding: future_fstrings
         __requires__ = 'foo'
         f'boo'
         f'coo'
         ''').lstrip()
     reqs = scripts.DepsReader(script).read()
     assert reqs == ['foo']
コード例 #4
0
ファイル: test_scripts.py プロジェクト: pombredanne/pip-run
 def test_single_dep(self):
     script = textwrap.dedent('''
         __requires__='foo'
         ''')
     assert scripts.DepsReader(script).read() == ['foo']
コード例 #5
0
ファイル: test_scripts.py プロジェクト: pombredanne/pip-run
 def test_reads_files_with_multiple_assignment(self):
     script = textwrap.dedent('''
         __requires__=['foo']
         x, a = [a, x]
         ''')
     assert scripts.DepsReader(script).read() == ['foo']
コード例 #6
0
ファイル: test_scripts.py プロジェクト: pombredanne/pip-run
 def test_reads_files_with_attribute_assignment(self):
     script = textwrap.dedent('''
         __requires__=['foo']
         x.a = 'bar'
         ''')
     assert scripts.DepsReader(script).read() == ['foo']