Minor fix

This commit is contained in:
Dion Moult
2020-07-16 13:05:50 +10:00
parent ee4a93c0d3
commit c885652338
+6 -6
View File
@@ -34,7 +34,7 @@ def get_resource_path(relative_path):
def run_tests(args): def run_tests(args):
if not get_features(args): if not get_features(args):
print('No requirements could be found to check.') print('No features could be found to check.')
return False return False
behave_args = [get_resource_path('features')] behave_args = [get_resource_path('features')]
if args.advanced_arguments: if args.advanced_arguments:
@@ -51,20 +51,20 @@ def get_features(args):
if args.feature: if args.feature:
shutil.copyfile(args.feature, os.path.join( shutil.copyfile(args.feature, os.path.join(
get_resource_path('features'), get_resource_path('features'),
os.path.basename(args.feature)[0:-len('.requirement')] + '.feature')) os.path.basename(args.feature)))
return True return True
if os.path.exists('features') and is_dist: if os.path.exists('features') and is_dist:
shutil.copytree('features', get_resource_path('features')) shutil.copytree('features', get_resource_path('features'))
has_features = True has_features = True
for f in os.listdir('.'): for f in os.listdir('.'):
if not f.endswith('.requirement'): if not f.endswith('.feature'):
continue continue
if args.feature and args.feature != f: if args.feature and args.feature != f:
continue continue
has_features = True has_features = True
shutil.copyfile(f, os.path.join( shutil.copyfile(f, os.path.join(
get_resource_path('features'), get_resource_path('features'),
os.path.basename(f)[0:-len('.requirement')] + '.feature')) os.path.basename(f)))
return has_features return has_features
@@ -125,7 +125,7 @@ class TestPurger:
for filename in Path('features/').glob('*.feature'): for filename in Path('features/').glob('*.feature'):
filenames.append(filename) filenames.append(filename)
for f in os.listdir('.'): for f in os.listdir('.'):
if f.endswith('.requirement'): if f.endswith('.feature'):
filenames.append(f) filenames.append(f)
for filename in filenames: for filename in filenames:
@@ -181,7 +181,7 @@ parser.add_argument(
'-f', '-f',
'--feature', '--feature',
type=str, type=str,
help='Specify a requirements feature file to test', help='Specify a feature file to test',
default='') default='')
parser.add_argument( parser.add_argument(
'-a', '-a',