Skip to content

Commit

Permalink
Update tests.py to allow a single file to be tested, to help work tow…
Browse files Browse the repository at this point in the history
…ards #22
  • Loading branch information
thefinn93 committed Nov 26, 2015
1 parent 5c1ff01 commit b492c2a
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,17 @@ def validate(path):
print(" %sInvalid JSON!%s" % (RED, END))
return False

success = True
for directory, subdirs, files in os.walk('.'):
if len(files) > 0:
for f in files:
if f.endswith('.k'):
result = validate("%s/%s" % (directory, f))
if not result:
success = False
if not success:
sys.exit(1)
if __name__ == "__main__":
success = True
if len(sys.argv) == 2:
success = validate(sys.argv[1])
else:
for directory, subdirs, files in os.walk('.'):
if len(files) > 0:
for f in files:
if f.endswith('.k'):
result = validate("%s/%s" % (directory, f))
if not result:
success = False
if not success:
sys.exit(1)

0 comments on commit b492c2a

Please sign in to comment.