mirror of
https://github.com/mandiant/capa.git
synced 2025-12-22 23:26:21 -08:00
improvements for PR #355
This commit is contained in:
@@ -458,12 +458,10 @@ def main(argv=None):
|
|||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description=desc, epilog=epilog, formatter_class=argparse.RawDescriptionHelpFormatter
|
description=desc, epilog=epilog, formatter_class=argparse.RawDescriptionHelpFormatter
|
||||||
)
|
)
|
||||||
# TODO: decode won't work for python3
|
|
||||||
if sys.version_info >= (3, 0):
|
if sys.version_info >= (3, 0):
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
# in #328 we noticed that the sample path is not handled correctly if it contains non-ASCII characters
|
# Python 3 str handles non-ASCII arguments correctly
|
||||||
# https://stackoverflow.com/a/22947334/ offers a solution and decoding using getfilesystemencoding works
|
|
||||||
# in our testing, however other sources suggest `sys.stdin.encoding` (https://stackoverflow.com/q/4012571/)
|
|
||||||
"sample",
|
"sample",
|
||||||
type=str,
|
type=str,
|
||||||
help="path to sample to analyze",
|
help="path to sample to analyze",
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ from fixtures import *
|
|||||||
indirect=["sample", "scope"],
|
indirect=["sample", "scope"],
|
||||||
)
|
)
|
||||||
def test_smda_features(sample, scope, feature, expected):
|
def test_smda_features(sample, scope, feature, expected):
|
||||||
|
with xfail(sys.version_info < (3, 0), reason="SMDA only works on py3"):
|
||||||
do_test_feature_presence(get_smda_extractor, sample, scope, feature, expected)
|
do_test_feature_presence(get_smda_extractor, sample, scope, feature, expected)
|
||||||
|
|
||||||
|
|
||||||
@@ -25,4 +26,5 @@ def test_smda_features(sample, scope, feature, expected):
|
|||||||
indirect=["sample", "scope"],
|
indirect=["sample", "scope"],
|
||||||
)
|
)
|
||||||
def test_smda_feature_counts(sample, scope, feature, expected):
|
def test_smda_feature_counts(sample, scope, feature, expected):
|
||||||
|
with xfail(sys.version_info < (3, 0), reason="SMDA only works on py3"):
|
||||||
do_test_feature_count(get_smda_extractor, sample, scope, feature, expected)
|
do_test_feature_count(get_smda_extractor, sample, scope, feature, expected)
|
||||||
|
|||||||
Reference in New Issue
Block a user