-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Rusty Brooks
committed
Mar 12, 2020
1 parent
953d4f1
commit 8fca8d8
Showing
3 changed files
with
36 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,12 +5,12 @@ | |
|
||
setup( | ||
name='OTXv2', | ||
version='1.5.7', | ||
version='1.5.8', | ||
description='AlienVault OTX API', | ||
author='AlienVault Team', | ||
author_email='[email protected]', | ||
url='https://github.com/AlienVault-Labs/OTX-Python-SDK', | ||
download_url='https://github.com/AlienVault-Labs/OTX-Python-SDK/tarball/1.5.7', | ||
download_url='https://github.com/AlienVault-Labs/OTX-Python-SDK/tarball/1.5.8', | ||
py_modules=['OTXv2', 'IndicatorTypes','patch_pulse'], | ||
install_requires=['requests', 'python-dateutil', 'pytz'] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -526,7 +526,7 @@ def test_add_or_update_indicators(self): | |
# add some indicators and update others. omitted indicators should stay same | ||
indicators = [ | ||
{'indicator': "two.com", 'type': 'domain'}, # no change | ||
{'indicator': "three.com", 'type': 'domain'}, # new indicator | ||
{'indicator': "three.com", 'type': 'domain'}, # new indicator | ||
{'indicator': "one.com", 'type': 'domain', 'title': 'one.com title'}, # change title | ||
] | ||
self.otx.add_or_update_pulse_indicators(pulse_id, indicators) | ||
|
@@ -566,12 +566,13 @@ def test_add_or_update_indicators(self): | |
self.assertEqual(expected, actual) | ||
|
||
# set a new expiration | ||
new_expiration = (datetime.datetime.utcnow().replace(microsecond=0) + datetime.timedelta(days=14)).isoformat() | ||
indicators = [ | ||
{'indicator': u'8.8.8.8', 'is_active': 1, 'expiration': '2020-01-01T00:00:00'}, | ||
{'indicator': u'8.8.8.8', 'expiration': new_expiration}, | ||
] | ||
self.otx.add_or_update_pulse_indicators(pulse_id, indicators) | ||
expected = [ | ||
{'indicator': u'8.8.8.8', 'type': u'IPv4', 'expiration': '2020-01-01T00:00:00', 'is_active': 1, 'title': u''}, | ||
{'indicator': u'8.8.8.8', 'type': u'IPv4', 'expiration': new_expiration, 'is_active': 1, 'title': u''}, | ||
{'indicator': u'[email protected]', 'type': u'email', 'expiration': None, 'is_active': 1, 'title': u''}, | ||
{'indicator': u'[email protected]', 'type': u'email', 'expiration': None, 'is_active': 1, 'title': u''}, | ||
{'indicator': u'one.com', 'type': u'domain', 'expiration': None, 'is_active': 1, 'title': u'one.com title'}, | ||
|
@@ -881,7 +882,7 @@ def _test_backoff(self): | |
|
||
def test_user_agent(self): | ||
o = OTXv2(self.api_key, server=ALIEN_DEV_SERVER, project='foo') | ||
self.assertEqual(o.headers['User-Agent'], 'OTX Python foo/1.5.7') | ||
self.assertEqual(o.headers['User-Agent'], 'OTX Python foo/1.5.8') | ||
|
||
o = OTXv2(self.api_key, server=ALIEN_DEV_SERVER, user_agent='foo') | ||
self.assertEqual(o.headers['User-Agent'], 'foo') | ||
|