Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yara-python
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-depend
yara-python
Commits
6f1cac0e
Commit
6f1cac0e
authored
8 years ago
by
plusvic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test case for modules callback
parent
7fd19abf
master
…
v4.4.0
v4.3.1
v4.3.0
v4.2.3
v4.2.0
v4.1.3
v4.1.2
v4.1.0
v4.0.5
v4.0.4
v4.0.3
v4.0.2
v4.0.1
v4.0.0
v3.11.0
v3.10.0
v3.9.0
v3.8.1
v3.8.0
v3.7.0
v3.6.3
v3.6.2
v3.6.1
v3.6.0
v3.5.0
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
tests.py
tests.py
+17
-0
No files found.
tests.py
View file @
6f1cac0e
...
...
@@ -915,6 +915,23 @@ class TestYara(unittest.TestCase):
self
.
assertTrue
(
len
(
m
)
==
1
)
def
testModuleData
(
self
):
data
=
{}
def
callback
(
module_data
):
data
[
'constants'
]
=
module_data
.
get
(
'constants'
)
r1
=
yara
.
compile
(
source
=
'import "tests" rule test { condition: false }'
)
r1
.
match
(
data
=
''
,
modules_callback
=
callback
)
self
.
assertTrue
(
data
[
'constants'
][
'foo'
]
==
'foo'
)
self
.
assertTrue
(
data
[
'constants'
][
'empty'
]
==
''
)
self
.
assertTrue
(
data
[
'constants'
][
'one'
]
==
1
)
self
.
assertTrue
(
data
[
'constants'
][
'two'
]
==
2
)
if
__name__
==
"__main__"
:
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment