From ec5cec619dde6284e446730a937e13cb89b25d2d Mon Sep 17 00:00:00 2001 From: William Ballenthin Date: Tue, 18 May 2021 13:35:24 -0600 Subject: [PATCH] rules: add tests demonstrating mnemonic descriptions --- capa/features/extractors/viv/insn.py | 2 -- tests/test_rules.py | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/capa/features/extractors/viv/insn.py b/capa/features/extractors/viv/insn.py index f6c9273c..0dcf1e87 100644 --- a/capa/features/extractors/viv/insn.py +++ b/capa/features/extractors/viv/insn.py @@ -5,8 +5,6 @@ # Unless required by applicable law or agreed to in writing, software distributed under the License # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and limitations under the License. -import sys - import viv_utils import envi.memory import viv_utils.flirt diff --git a/tests/test_rules.py b/tests/test_rules.py index 8bc42e8c..7035892e 100644 --- a/tests/test_rules.py +++ b/tests/test_rules.py @@ -83,6 +83,7 @@ def test_rule_descriptions(): description: string description - string: '/myregex/' description: regex description + - mnemonic: inc = mnemonic description # TODO - count(number(2 = number description)): 2 - or: - description: or description @@ -104,6 +105,8 @@ def test_rule_descriptions(): for child in statement.get_children(): rec(child) else: + if isinstance(statement.value, str): + assert "description" not in statement.value assert statement.description == statement.name + " description" rec(r.statement)