Merge branch 'master' of github.com:oasis-open/cti-python-stix2

stix2.1
Emmanuelle Vargas-Gonzalez 2017-06-02 07:15:01 -04:00
commit 0cf0f97143
7 changed files with 15 additions and 9 deletions

View File

@ -1,7 +1,7 @@
[settings] [settings]
check=1 check=1
diff=1 diff=1
known_third_party=dateutil,pytest,pytz,six known_third_party=dateutil,pytest,pytz,six,requests
known_first_party=stix2 known_first_party=stix2
not_skip=__init__.py not_skip=__init__.py
force_sort_within_sections=1 force_sort_within_sections=1

View File

@ -14,6 +14,9 @@ python:
install: install:
- pip install -U pip setuptools - pip install -U pip setuptools
- pip install tox-travis pre-commit - pip install tox-travis pre-commit
- pip install codecov
script: script:
- tox - tox
- if [[ $TRAVIS_PYTHON_VERSION != 2.6 ]]; then pre-commit run --all-files; fi - if [[ $TRAVIS_PYTHON_VERSION != 2.6 ]]; then pre-commit run --all-files; fi
after_success:
- codecov

View File

@ -1,4 +1,5 @@
import json import json
from stix2.sources.taxii import TAXIIDataSource from stix2.sources.taxii import TAXIIDataSource
# Flask TAXII server - developmental # Flask TAXII server - developmental

View File

@ -5,6 +5,7 @@ install_requires = [
'pytz', 'pytz',
'six', 'six',
'python-dateutil', 'python-dateutil',
'requests',
] ]
setup( setup(

View File

@ -5,9 +5,12 @@ import copy
import datetime as dt import datetime as dt
import json import json
from .exceptions import (AtLeastOnePropertyError, DependentPropertiesError, ExtraPropertiesError, ImmutableError, from .exceptions import (AtLeastOnePropertyError, DependentPropertiesError,
InvalidObjRefError, InvalidValueError, MissingPropertiesError, MutuallyExclusivePropertiesError, ExtraPropertiesError, ImmutableError,
RevokeError, UnmodifiablePropertyError) InvalidObjRefError, InvalidValueError,
MissingPropertiesError,
MutuallyExclusivePropertiesError, RevokeError,
UnmodifiablePropertyError)
from .utils import NOW, format_datetime, get_timestamp, parse_into_datetime from .utils import NOW, format_datetime, get_timestamp, parse_into_datetime
__all__ = ['STIXJSONEncoder', '_STIXBase'] __all__ = ['STIXJSONEncoder', '_STIXBase']

View File

@ -206,7 +206,7 @@ class TAXIIDataSource(DataSource):
all_data.append(stix_obj) all_data.append(stix_obj)
except requests.exceptions.RequestException as e: except requests.exceptions.RequestException as e:
raise raise e
# raise type(e), type(e)(e.message + # raise type(e), type(e)(e.message +
# "Attempting to connect to %s" % coll_url) # "Attempting to connect to %s" % coll_url)

View File

@ -8,10 +8,8 @@ deps =
pytest pytest
pytest-cov pytest-cov
coverage coverage
codecov
commands = commands =
py.test --cov=stix2 stix2/test/ py.test --cov=stix2 stix2/test/ --cov-report term-missing
codecov
passenv = CI TRAVIS TRAVIS_* passenv = CI TRAVIS TRAVIS_*
@ -32,7 +30,7 @@ max-line-length=160
[testenv:isort-check] [testenv:isort-check]
deps = isort deps = isort
commands = isort -rc stix2 -c -df commands = isort -rc stix2 examples -c -df
[travis] [travis]
python = python =