Skip to content

Commit

Permalink
Added tests for signature stats
Browse files Browse the repository at this point in the history
  • Loading branch information
cccs-sgaron committed May 21, 2020
1 parent 4a2dafd commit 3aac6f2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/test_signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_download_file_handle(datastore, client):
signature_id = random_id_from_collection(datastore, 'signature', q="type:yara")
query = "id:{}".format(signature_id)
output = "/tmp/sigs_{}_obj".format(get_random_id())
res = client.signature.download(query=query, output=open(output, 'wb'), safe=False)
res = client.signature.download(query=query, output=open(output, 'wb'))
assert res

found = False
Expand Down Expand Up @@ -134,6 +134,11 @@ def test_download_raw(datastore, client):
assert b"suricata/sample_suricata.rules" in res


def test_stats(datastore, client):
res = client.signature.stats()
assert len(res) == datastore.signature.search('id:*')['total']


def test_update_available(datastore, client):
res = client.signature.update_available()
assert res['update_available']
Expand Down

0 comments on commit 3aac6f2

Please sign in to comment.