Skip to content

Commit

Permalink
Merge pull request #60 from oasis-open/no-files
Browse files Browse the repository at this point in the history
Fix bug when no 'files' option provided to library
  • Loading branch information
clenk authored Jun 14, 2018
2 parents 84a44f2 + 747d064 commit 638fdd0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
12 changes: 11 additions & 1 deletion stix2validator/test/util_tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .. import parse_args
from .. import parse_args, validate_string
from .indicator_tests import VALID_INDICATOR


def test_parse_args():
Expand Down Expand Up @@ -34,3 +35,12 @@ def test_parse_args():
assert options.no_cache is True
assert options.refresh_cache is True
assert options.clear_cache is True


def test_parse_args_no_files():
args = []
options = parse_args(args)
assert options.files == ""

results = validate_string(VALID_INDICATOR, options)
assert results.is_valid
4 changes: 4 additions & 0 deletions stix2validator/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ def parse_args(cmd_args, is_script=False):
)

args = parser.parse_args(cmd_args)

if not is_script:
args.files = ""

return ValidationOptions(args)


Expand Down

0 comments on commit 638fdd0

Please sign in to comment.