예제 #1
0
 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
 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
 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
 def test_single_dep(self):
     script = textwrap.dedent('''
         __requires__='foo'
         ''')
     assert scripts.DepsReader(script).read() == ['foo']
예제 #5
0
 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
 def test_reads_files_with_attribute_assignment(self):
     script = textwrap.dedent('''
         __requires__=['foo']
         x.a = 'bar'
         ''')
     assert scripts.DepsReader(script).read() == ['foo']