Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloperezj committed Sep 19, 2024
1 parent b821dde commit 3e1730f
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def test_fetch_indicators_command(mocker):
'gtithreatscore', 'gtiseverity', 'gtiverdict', 'actor', 'malwarefamily',
}
assert indicator['value'] == '9ceef6e3194cb4babe53863b686a012be4a1b368aca7c108df80b77adb5a1c25'
assert indicator['value'] == indicator['fields']['sha256']
elif indicator['type'] == FeedIndicatorType.Domain:
assert set(indicator['fields'].keys()) == {
'admincountry', 'adminname', 'adminemail', 'adminphone', 'registrantcountry',
Expand All @@ -84,20 +85,25 @@ def test_fetch_indicators_command(mocker):
'gtithreatscore', 'gtiseverity', 'gtiverdict', 'actor', 'malwarefamily',
}
assert indicator['value'] == 'account-facebook.com'
assert indicator['fields']['adminemail'] == '[email protected]'
assert indicator['fields']['registrantcountry'] == 'US'
assert indicator['fields']['registrarabusephone'] == '+1.2024422253'
elif indicator['type'] == FeedIndicatorType.URL:
assert set(indicator['fields'].keys()) == {
'tags', 'firstseenbysource', 'lastseenbysource', 'updateddate',
'detectionengines', 'positivedetections',
'gtithreatscore', 'gtiseverity', 'gtiverdict', 'actor', 'malwarefamily',
}
assert indicator['value'] == 'https://www.leparisien.wf/politique/Jupiter-et-une-bande-d'
assert indicator['fields']['firstseenbysource'] == 1722360511
elif indicator['type'] == FeedIndicatorType.IP:
assert set(indicator['fields'].keys()) == {
'tags', 'firstseenbysource', 'lastseenbysource', 'updateddate',
'detectionengines', 'positivedetections', 'countrycode',
'gtithreatscore', 'gtiseverity', 'gtiverdict', 'actor', 'malwarefamily',
}
assert indicator['value'] == '8.8.8.8'
assert indicator['fields']['countrycode'] == 'US'
else:
raise ValueError(f'Unknown type: {indicator["type"]}')

Expand Down

0 comments on commit 3e1730f

Please sign in to comment.