test(e2e): eliminate all legacy mocks and establish real-world sim suite
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import logging
|
||||
import os
|
||||
from unittest.mock import MagicMock
|
||||
from unittest.mock import MagicMock, create_autospec
|
||||
|
||||
import pytest
|
||||
|
||||
from GramAddict.core.device_facade import DeviceFacade
|
||||
from GramAddict.core.telepathic_engine import TelepathicEngine
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
parser.addoption(
|
||||
@@ -29,12 +32,6 @@ class MockConfigs:
|
||||
self.args = args
|
||||
|
||||
|
||||
from unittest.mock import MagicMock, create_autospec
|
||||
|
||||
from GramAddict.core.device_facade import DeviceFacade
|
||||
from GramAddict.core.telepathic_engine import TelepathicEngine
|
||||
|
||||
|
||||
def create_mock_device():
|
||||
mock = create_autospec(DeviceFacade, instance=True)
|
||||
mock.app_id = "com.instagram.android"
|
||||
@@ -154,8 +151,8 @@ def reset_singletons():
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def telepathic_mock(monkeypatch, request):
|
||||
if request.config.getoption("--live"):
|
||||
# TelepathicEngine is a singleton, allow it to run natively
|
||||
if request.config.getoption("--live") or "e2e" in str(request.node.fspath):
|
||||
# TelepathicEngine is a singleton, allow it to run natively in e2e or live mode
|
||||
return None
|
||||
import GramAddict.core.telepathic_engine
|
||||
|
||||
|
||||
Reference in New Issue
Block a user