From 309b266fe97b4d3cf5f2f91e3f5fa43efe2541f3 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 27 Mar 2023 11:07:30 +0200 Subject: [PATCH] fix import in tests --- tests/test_device.py | 14 +++----------- tests/test_documents.py | 6 +----- tests/test_snapshot.py | 10 +--------- tests/test_tag.py | 4 +--- 4 files changed, 6 insertions(+), 28 deletions(-) diff --git a/tests/test_device.py b/tests/test_device.py index 7d82ce55..edf83bdf 100644 --- a/tests/test_device.py +++ b/tests/test_device.py @@ -1,28 +1,21 @@ -import copy import datetime from uuid import UUID import pytest from colour import Color -from ereuse_utils.naming import Naming -from ereuse_utils.test import ANY from flask import g -from pytest import raises from sqlalchemy.util import OrderedSet from ereuse_devicehub.client import Client, UserClient from ereuse_devicehub.db import db from ereuse_devicehub.devicehub import Devicehub +from ereuse_devicehub.ereuse_utils.test import ANY from ereuse_devicehub.resources.action import models as m from ereuse_devicehub.resources.action.models import Remove, TestConnectivity from ereuse_devicehub.resources.agent.models import Person from ereuse_devicehub.resources.device import models as d from ereuse_devicehub.resources.device.schemas import Device as DeviceS -from ereuse_devicehub.resources.device.sync import ( - MismatchBetweenTags, - MismatchBetweenTagsAndHid, - Sync, -) +from ereuse_devicehub.resources.device.sync import Sync from ereuse_devicehub.resources.enums import ( ComputerChassis, DisplayTech, @@ -32,10 +25,9 @@ from ereuse_devicehub.resources.enums import ( ) from ereuse_devicehub.resources.tag.model import Tag from ereuse_devicehub.resources.user import User -from ereuse_devicehub.teal.db import ResourceNotFound from ereuse_devicehub.teal.enums import Layouts from tests import conftest -from tests.conftest import file, json_encode, yaml2json +from tests.conftest import file, yaml2json @pytest.mark.mvp diff --git a/tests/test_documents.py b/tests/test_documents.py index 743577b5..18888ae3 100644 --- a/tests/test_documents.py +++ b/tests/test_documents.py @@ -1,26 +1,22 @@ import csv import hashlib -from datetime import datetime from io import BytesIO, StringIO from pathlib import Path import pytest import teal.marshmallow -from ereuse_utils.test import ANY -from flask import url_for -from werkzeug.exceptions import Unauthorized from ereuse_devicehub import auth from ereuse_devicehub.client import Client, UserClient from ereuse_devicehub.db import db from ereuse_devicehub.devicehub import Devicehub +from ereuse_devicehub.ereuse_utils.test import ANY from ereuse_devicehub.resources.action.models import Allocate, Live, Snapshot from ereuse_devicehub.resources.device import models as d from ereuse_devicehub.resources.documents import documents from ereuse_devicehub.resources.enums import SessionType from ereuse_devicehub.resources.hash_reports import ReportHash from ereuse_devicehub.resources.lot.models import Lot -from ereuse_devicehub.resources.tag.model import Tag from ereuse_devicehub.resources.tradedocument.models import TradeDocument from ereuse_devicehub.resources.user.models import Session from tests import conftest diff --git a/tests/test_snapshot.py b/tests/test_snapshot.py index ca4f323b..6557565d 100644 --- a/tests/test_snapshot.py +++ b/tests/test_snapshot.py @@ -10,19 +10,17 @@ from uuid import uuid4 import pytest from boltons import urlutils -from ereuse_utils.test import ANY -from requests.exceptions import HTTPError from ereuse_devicehub.client import Client, UserClient from ereuse_devicehub.db import db from ereuse_devicehub.devicehub import Devicehub +from ereuse_devicehub.ereuse_utils.test import ANY from ereuse_devicehub.parser.models import SnapshotsLog from ereuse_devicehub.resources.action.models import ( Action, BenchmarkDataStorage, BenchmarkProcessor, EraseSectors, - EreusePrice, Ready, Snapshot, SnapshotRequest, @@ -30,17 +28,11 @@ from ereuse_devicehub.resources.action.models import ( ) from ereuse_devicehub.resources.action.views.snapshot import save_json from ereuse_devicehub.resources.device import models as m -from ereuse_devicehub.resources.device.exceptions import NeedsId from ereuse_devicehub.resources.device.models import Device, SolidStateDrive -from ereuse_devicehub.resources.device.sync import ( - MismatchBetweenProperties, - MismatchBetweenTagsAndHid, -) from ereuse_devicehub.resources.documents import documents from ereuse_devicehub.resources.enums import ComputerChassis, SnapshotSoftware from ereuse_devicehub.resources.tag import Tag from ereuse_devicehub.resources.user.models import User -from ereuse_devicehub.teal.db import DBError, UniqueViolation from ereuse_devicehub.teal.marshmallow import ValidationError from tests import conftest from tests.conftest import file, file_json, json_encode, yaml2json diff --git a/tests/test_tag.py b/tests/test_tag.py index 14807d3c..2cc789f5 100644 --- a/tests/test_tag.py +++ b/tests/test_tag.py @@ -3,14 +3,13 @@ import pathlib import pytest import requests_mock from boltons.urlutils import URL -from ereuse_utils.session import DevicehubClient from flask import g from pytest import raises from ereuse_devicehub.client import Client, UserClient from ereuse_devicehub.db import db from ereuse_devicehub.devicehub import Devicehub -from ereuse_devicehub.resources.action.models import Snapshot +from ereuse_devicehub.ereuse_utils.session import DevicehubClient from ereuse_devicehub.resources.agent.models import Organization from ereuse_devicehub.resources.device.models import Desktop, Device from ereuse_devicehub.resources.enums import ComputerChassis @@ -29,7 +28,6 @@ from ereuse_devicehub.teal.db import ( ) from ereuse_devicehub.teal.marshmallow import ValidationError from tests import conftest -from tests.conftest import json_encode, yaml2json @pytest.mark.mvp