Merge pull request #54 from emmanvg/master

Update README and tox configuration
stix2.1
Greg Back 2017-09-11 16:40:12 +00:00 committed by GitHub
commit f070a4358e
2 changed files with 12 additions and 5 deletions

View File

@ -49,17 +49,25 @@ not provided as keyword arguments:
type. You can also provide the type explicitly, but this is not
necessary:
``python indicator = Indicator(type='indicator', ...)``
.. code:: python
indicator = Indicator(type='indicator', ...)
Passing a value for ``type`` that does not match the class being
constructed will cause an error:
``python >>> indicator = Indicator(type='xxx', ...) stix2.exceptions.InvalidValueError: Invalid value for Indicator 'type': must equal 'indicator'.``
.. code:: python
>>> indicator = Indicator(type='xxx', ...)
stix2.exceptions.InvalidValueError: Invalid value for Indicator 'type': must equal 'indicator'.
- If not provided, ``id`` will be generated randomly. If you provide an
``id`` argument, it must begin with the correct prefix:
``python >>> indicator = Indicator(id="campaign--63ce9068-b5ab-47fa-a2cf-a602ea01f21a") stix2.exceptions.InvalidValueError: Invalid value for Indicator 'id': must start with 'indicator--'.``
.. code:: python
>>> indicator = Indicator(id="campaign--63ce9068-b5ab-47fa-a2cf-a602ea01f21a")
stix2.exceptions.InvalidValueError: Invalid value for Indicator 'id': must start with 'indicator--'.
- If not provided, ``created`` and ``modified`` will be set to the
(same) current time.

View File

@ -19,10 +19,9 @@ deps =
pycodestyle
commands =
pycodestyle ./stix2
flake8 --max-line-length=160
flake8
[pycodestyle]
ignore=
max-line-length=160
[flake8]