Style/lint fixes
parent
6c3a689f02
commit
53ddf32e8c
|
@ -1,29 +1,24 @@
|
||||||
import pytest
|
|
||||||
import requests
|
|
||||||
|
|
||||||
from stix2.sources import taxii
|
from stix2.sources import taxii
|
||||||
|
|
||||||
|
|
||||||
#Data Source (common API)
|
|
||||||
|
|
||||||
|
|
||||||
#TAXII
|
|
||||||
def test_ds_taxii():
|
def test_ds_taxii():
|
||||||
ds = taxii.TAXIIDataSource()
|
ds = taxii.TAXIIDataSource()
|
||||||
assert ds.name == 'TAXII'
|
assert ds.name == 'TAXII'
|
||||||
|
|
||||||
|
|
||||||
def test_ds_taxii_name():
|
def test_ds_taxii_name():
|
||||||
ds = taxii.TAXIIDataSource(name='My Data Source Name')
|
ds = taxii.TAXIIDataSource(name='My Data Source Name')
|
||||||
assert ds.name == "My Data Source Name"
|
assert ds.name == "My Data Source Name"
|
||||||
|
|
||||||
|
|
||||||
def test_ds_params():
|
def test_ds_params():
|
||||||
url = "http://taxii_url.com:5000"
|
url = "http://taxii_url.com:5000"
|
||||||
creds = {"username": "Wade", "password": "Wilson"}
|
creds = {"username": "Wade", "password": "Wilson"}
|
||||||
ds = taxii.TAXIIDataSource(api_root=url,
|
ds = taxii.TAXIIDataSource(api_root=url, auth=creds)
|
||||||
auth= creds)
|
|
||||||
assert ds.taxii_info['api_root']['url'] == url
|
assert ds.taxii_info['api_root']['url'] == url
|
||||||
assert ds.taxii_info['auth'] == creds
|
assert ds.taxii_info['auth'] == creds
|
||||||
|
|
||||||
|
|
||||||
def test_parse_taxii_filters():
|
def test_parse_taxii_filters():
|
||||||
query = [
|
query = [
|
||||||
{
|
{
|
||||||
|
@ -136,32 +131,24 @@ def test_add_get_remove_filter():
|
||||||
assert statuses[6]['errors'][0] == expected_errors[3]
|
assert statuses[6]['errors'][0] == expected_errors[3]
|
||||||
|
|
||||||
|
|
||||||
|
# def test_data_source_file():
|
||||||
#File
|
# ds = file.FileDataSource()
|
||||||
|
#
|
||||||
'''
|
# assert ds.name == "DataSource"
|
||||||
|
#
|
||||||
def test_data_source_file():
|
#
|
||||||
ds = file.FileDataSource()
|
# def test_data_source_name():
|
||||||
|
# ds = file.FileDataSource(name="My File Data Source")
|
||||||
assert ds.name == "DataSource"
|
#
|
||||||
|
# assert ds.name == "My File Data Source"
|
||||||
|
#
|
||||||
def test_data_source_name():
|
#
|
||||||
ds = file.FileDataSource(name="My File Data Source")
|
# def test_data_source_get():
|
||||||
|
# ds = file.FileDataSource(name="My File Data Source")
|
||||||
assert ds.name == "My File Data Source"
|
#
|
||||||
|
# with pytest.raises(NotImplementedError):
|
||||||
|
# ds.get("foo")
|
||||||
def test_data_source_get():
|
#
|
||||||
ds = file.FileDataSource(name="My File Data Source")
|
# #filter testing
|
||||||
|
# def test_add_filter():
|
||||||
with pytest.raises(NotImplementedError):
|
# ds = file.FileDataSource()
|
||||||
ds.get("foo")
|
|
||||||
|
|
||||||
#filter testing
|
|
||||||
def test_add_filter():
|
|
||||||
ds = file.FileDataSource()
|
|
||||||
|
|
||||||
|
|
||||||
'''
|
|
||||||
|
|
Loading…
Reference in New Issue