mirror of
https://github.com/mandiant/capa.git
synced 2025-12-12 15:49:46 -08:00
tests: fix fixture imports
This commit is contained in:
8
.github/ruff.toml
vendored
8
.github/ruff.toml
vendored
@@ -49,5 +49,13 @@ exclude = [
|
||||
# F401: `foo` imported but unused
|
||||
# F811 Redefinition of unused `foo`
|
||||
"tests/test_main.py" = ["F401", "F811"]
|
||||
"tests/test_proto.py" = ["F401", "F811"]
|
||||
"tests/test_freeze.py" = ["F401", "F811"]
|
||||
"tests/test_function_id.py" = ["F401", "F811"]
|
||||
"tests/test_viv_features.py" = ["F401", "F811"]
|
||||
"tests/test_binja_features.py" = ["F401", "F811"]
|
||||
"tests/test_pefile_features.py" = ["F401", "F811"]
|
||||
"tests/test_dnfile_features.py" = ["F401", "F811"]
|
||||
"tests/test_dotnet_features.py" = ["F401", "F811"]
|
||||
"tests/test_result_document.py" = ["F401", "F811"]
|
||||
"tests/test_dotnetfile_features.py" = ["F401", "F811"]
|
||||
|
||||
@@ -10,6 +10,7 @@ import logging
|
||||
|
||||
import pytest
|
||||
import fixtures
|
||||
from fixtures import scope, sample
|
||||
|
||||
import capa.main
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
# See the License for the specific language governing permissions and limitations under the License.
|
||||
|
||||
import fixtures
|
||||
from fixtures import parametrize
|
||||
from fixtures import scope, sample
|
||||
|
||||
|
||||
@parametrize(
|
||||
@fixtures.parametrize(
|
||||
"sample,scope,feature,expected",
|
||||
fixtures.FEATURE_PRESENCE_TESTS_DOTNET,
|
||||
indirect=["sample", "scope"],
|
||||
@@ -19,7 +19,7 @@ def test_dnfile_features(sample, scope, feature, expected):
|
||||
fixtures.do_test_feature_presence(fixtures.get_dnfile_extractor, sample, scope, feature, expected)
|
||||
|
||||
|
||||
@parametrize(
|
||||
@fixtures.parametrize(
|
||||
"sample,scope,feature,expected",
|
||||
fixtures.FEATURE_COUNT_TESTS_DOTNET,
|
||||
indirect=["sample", "scope"],
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
# See the License for the specific language governing permissions and limitations under the License.
|
||||
|
||||
import fixtures
|
||||
from fixtures import parametrize
|
||||
from fixtures import scope, sample, b9f5b_dotnetfile_extractor, mixed_mode_64_dotnetfile_extractor
|
||||
|
||||
|
||||
@parametrize(
|
||||
@fixtures.parametrize(
|
||||
"sample,scope,feature,expected",
|
||||
fixtures.FEATURE_PRESENCE_TESTS_DOTNET,
|
||||
indirect=["sample", "scope"],
|
||||
@@ -19,7 +19,7 @@ def test_dnfile_features(sample, scope, feature, expected):
|
||||
fixtures.do_test_feature_presence(fixtures.get_dnfile_extractor, sample, scope, feature, expected)
|
||||
|
||||
|
||||
@parametrize(
|
||||
@fixtures.parametrize(
|
||||
"extractor,function,expected",
|
||||
[
|
||||
("b9f5b_dotnetfile_extractor", "is_dotnet_file", True),
|
||||
|
||||
@@ -8,14 +8,20 @@
|
||||
|
||||
import pytest
|
||||
import fixtures
|
||||
from fixtures import parametrize
|
||||
from fixtures import (
|
||||
FEATURE_PRESENCE_TESTS_DOTNET,
|
||||
scope,
|
||||
sample,
|
||||
b9f5b_dotnetfile_extractor,
|
||||
mixed_mode_64_dotnetfile_extractor,
|
||||
)
|
||||
|
||||
import capa.features.file
|
||||
|
||||
|
||||
@parametrize(
|
||||
@fixtures.parametrize(
|
||||
"sample,scope,feature,expected",
|
||||
fixtures.FEATURE_PRESENCE_TESTS_DOTNET,
|
||||
FEATURE_PRESENCE_TESTS_DOTNET,
|
||||
indirect=["sample", "scope"],
|
||||
)
|
||||
def test_dotnetfile_features(sample, scope, feature, expected):
|
||||
@@ -28,7 +34,7 @@ def test_dotnetfile_features(sample, scope, feature, expected):
|
||||
fixtures.do_test_feature_presence(fixtures.get_dotnetfile_extractor, sample, scope, feature, expected)
|
||||
|
||||
|
||||
@parametrize(
|
||||
@fixtures.parametrize(
|
||||
"extractor,function,expected",
|
||||
[
|
||||
("b9f5b_dotnetfile_extractor", "is_dotnet_file", True),
|
||||
|
||||
@@ -11,6 +11,10 @@ import textwrap
|
||||
|
||||
import fixtures
|
||||
from fixtures import (
|
||||
z499c2_extractor,
|
||||
z9324d_extractor,
|
||||
pma16_01_extractor,
|
||||
pingtaest_extractor,
|
||||
_692f_dotnetfile_extractor,
|
||||
_1c444_dotnetfile_extractor,
|
||||
_039a6_dotnetfile_extractor,
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
# See the License for the specific language governing permissions and limitations under the License.
|
||||
import pytest
|
||||
import fixtures
|
||||
from fixtures import parametrize
|
||||
from fixtures import scope, sample
|
||||
|
||||
import capa.features.file
|
||||
|
||||
|
||||
@parametrize(
|
||||
@fixtures.parametrize(
|
||||
"sample,scope,feature,expected",
|
||||
fixtures.FEATURE_PRESENCE_TESTS,
|
||||
indirect=["sample", "scope"],
|
||||
|
||||
@@ -9,6 +9,7 @@ import copy
|
||||
from typing import Any
|
||||
|
||||
import pytest
|
||||
from fixtures import a3f3bbc_rd, a076114_rd, pma0101_rd, al_khaserx64_rd, al_khaserx86_rd, dotnet_1c444e_rd
|
||||
|
||||
import capa.rules
|
||||
import capa.render
|
||||
|
||||
@@ -9,6 +9,7 @@ import copy
|
||||
|
||||
import pytest
|
||||
import fixtures
|
||||
from fixtures import a3f3bbc_rd, a076114_rd, pma0101_rd, al_khaserx64_rd, al_khaserx86_rd, dotnet_1c444e_rd
|
||||
|
||||
import capa
|
||||
import capa.engine as ceng
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
# 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 fixtures
|
||||
from fixtures import scope, sample
|
||||
|
||||
|
||||
@fixtures.parametrize(
|
||||
|
||||
Reference in New Issue
Block a user