-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from opencybersecurityalliance/develop
2.3.24
- Loading branch information
Showing
6 changed files
with
74 additions
and
15 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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[bumpversion] | ||
current_version = 2.3.23 | ||
current_version = 2.3.24 | ||
commit = True | ||
tag = True | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from .helpers import tmp_storage | ||
|
||
|
||
def test_obs_attr_url(tmpdir, fake_bundle_file): | ||
store = tmp_storage(tmpdir) | ||
store.cache('q1', fake_bundle_file) | ||
data = store.extract_observeddata_attribute( | ||
'url', | ||
'last_observed') | ||
assert len(data) == 31 | ||
assert 'last_observed' in data[0] | ||
|
||
|
||
def test_obs_attr_url_only(tmpdir, fake_bundle_file): | ||
store = tmp_storage(tmpdir) | ||
store.cache('q1', fake_bundle_file) | ||
data = store.extract_observeddata_attribute('url', 'id', path=['value']) | ||
assert len(data) == 31 | ||
assert set(data[0].keys()) == {'observation_id', 'value'} | ||
|
||
|
||
def test_obs_attr_multiple(tmpdir, fake_bundle_file): | ||
store = tmp_storage(tmpdir) | ||
store.cache('q1', fake_bundle_file) | ||
attrs = [ | ||
'number_observed', | ||
'first_observed', | ||
'last_observed', | ||
'id', | ||
] | ||
data = store.extract_observeddata_attribute('url', attrs) | ||
assert len(data) == 31 | ||
assert set(data[0].keys()) == { | ||
'number_observed', | ||
'first_observed', | ||
'last_observed', | ||
'observation_id', | ||
'value', | ||
'id', # The original url:id | ||
} |