forked from cuckoosandbox/cuckoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocessor_tests.py
More file actions
42 lines (32 loc) · 1019 Bytes
/
Copy pathprocessor_tests.py
File metadata and controls
42 lines (32 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Copyright (C) 2010-2015 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import os
import tempfile
from nose.tools import assert_equals
from lib.cuckoo.common.constants import CUCKOO_VERSION
from lib.cuckoo.common.abstracts import Processing, Signature
class ProcessingMock(Processing):
def run(self):
self.key = "foo"
foo = {
"bar" : "taz"
}
return foo
class SignatureMock(Signature):
name = "mock"
minimum = CUCKOO_VERSION.split("-")[0]
maximum = CUCKOO_VERSION.split("-")[0]
def run(self, results):
if "foo" in results:
return True
else:
return False
class SignatureAlterMock(SignatureMock):
def run(self, results):
results = None
class SignatureDisabledMock(SignatureMock):
enabled = False
class SignatureWrongVersionMock(SignatureMock):
minimum = "0.0..-abc"
maximum = "0.0..-abc"