Skip to content

Commit

Permalink
Fix generate cli command
Browse files Browse the repository at this point in the history
  • Loading branch information
otto-ifak committed Oct 1, 2024
1 parent d51df7c commit f825a50
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions aas_test_engines/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,10 @@ def generate_files(argv):
print(f"Directory '{args.directory}' already exists, please remove it")
exit(1)
os.mkdir(args.directory)
i = 0
for is_valid, sample in file.generate():
for idx, (is_valid, sample) in enumerate(file.generate()):
tag = 'valid' if is_valid else 'invalid'
with open(os.path.join(args.directory, f"{i}_{tag}.json"), "w") as f:
f.write(sample)
i += 1
if i > 2000:
break
with open(os.path.join(args.directory, f"{idx}_{tag}.json"), "w") as f:
json.dump(sample, f)


commands = {
Expand Down

0 comments on commit f825a50

Please sign in to comment.