Skip to content

Commit bcbee9b

Browse files
author
Li
committed
#253 Pypi: Fix the test to fit for the setup.py name
1 parent fce71b4 commit bcbee9b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/packagedcode/test_pypi.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@
2626
from __future__ import print_function
2727

2828
import os.path
29+
import shutil
2930

30-
from commoncode.testcase import FileBasedTesting
3131

32+
from commoncode.testcase import FileBasedTesting
3233
from packagedcode import pypi
3334

3435

@@ -45,7 +46,9 @@ def test_parse(self):
4546
assert 'https://github.com/nexB/scancode-toolkit' == package.homepage_url
4647

4748
def test_get_attribute(self):
48-
test_file = self.get_test_loc('pypi/setup2.py')
49+
test_input = self.get_test_loc('pypi/setup2.py')
50+
test_file = self.get_temp_file('setup.py')
51+
shutil.copyfile(test_input, test_file)
4952
assert 'scancode-toolkit' == pypi.get_attribute(test_file, 'name')
5053
assert '1.5.0' == pypi.get_attribute(test_file, 'version')
5154
assert 'ScanCode' == pypi.get_attribute(test_file, 'author')

0 commit comments

Comments
 (0)