Skip to content

Commit

Permalink
fixup! fixup! fixup! Validate ssl related filepaths beforehand.
Browse files Browse the repository at this point in the history
  • Loading branch information
matriv committed Jul 3, 2017
1 parent 0ca9dd2 commit 54cedbd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/crate/crash/test_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,13 @@ def test_ssl_params_missing_file(self):
"--ca-cert-file", "ca_cert_file"
]
parser = get_parser()

# Python 2
try:
FileNotFoundError
except NameError:
FileNotFoundError = IOError

with self.assertRaises(FileNotFoundError):
parse_args(parser)

Expand All @@ -590,6 +597,13 @@ def test_ssl_params_wrong_permision_file(self):
"--ca-cert-file", ca_cert_filename
]
parser = get_parser()

# Python 2
try:
PermissionError
except NameError:
PermissionError = IOError

with self.assertRaises(PermissionError):
parse_args(parser)

Expand Down

0 comments on commit 54cedbd

Please sign in to comment.