diff --git a/sith.py b/sith.py index 2f1eda18..f903eb61 100755 --- a/sith.py +++ b/sith.py @@ -86,6 +86,9 @@ class BaseAttacker(object): return self.record['data'][recid] def save_record(self, path): + directory = os.path.dirname(path) + if not os.path.isdir(directory): + os.makedirs(directory) with open(path, 'w') as f: json.dump(self.record, f) @@ -251,6 +254,7 @@ class AttackApp(object): einfo = sys.exc_info() pdb = __import__(debugger) pdb.post_mortem(einfo if debugger == 'pudb' else einfo[2]) + sys.exit(1) def add_parser(self, attacker_class, *args, **kwds): attacker = attacker_class() diff --git a/tox.ini b/tox.ini index c4d86518..8eb4e27c 100644 --- a/tox.ini +++ b/tox.ini @@ -16,3 +16,8 @@ deps = commands = coverage run --source jedi -m py.test coverage report +[testenv:sith] +deps = + argparse +commands = + {envpython} sith.py --record {envtmpdir}/record.json random {posargs:jedi}