Files
capa/tests/test_helpers.py
William Ballenthin 3faf175da7 *: add license header
closes #144
2020-07-15 14:14:53 -06:00

19 lines
487 B
Python

# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
import codecs
from capa.features.extractors import helpers
def test_all_zeros():
# Python 2: <str>
# Python 3: <bytes>
a = b"\x00\x00\x00\x00"
b = codecs.decode("00000000", "hex")
c = b"\x01\x00\x00\x00"
d = codecs.decode("01000000", "hex")
assert helpers.all_zeros(a) is True
assert helpers.all_zeros(b) is True
assert helpers.all_zeros(c) is False
assert helpers.all_zeros(d) is False