mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 15:37:45 +00:00
nuke mock dependency
This is already included in Python 3.3+ as unittest.mock
This commit is contained in:
parent
0022c810e5
commit
127c69c3ac
1
setup.py
1
setup.py
@ -100,7 +100,6 @@ setup(
|
||||
"mypy-lang>=0.4.6, <0.5",
|
||||
"rstcheck>=2.2, <4.0",
|
||||
"tox>=2.3, <3",
|
||||
"mock>=2.0, <2.1",
|
||||
"pytest>=3, <3.1",
|
||||
"pytest-cov>=2.2.1, <3",
|
||||
"pytest-timeout>=1.0.0, <2",
|
||||
|
@ -1,5 +1,5 @@
|
||||
import os
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from mitmproxy.test import tflow
|
||||
from mitmproxy.test import tutils
|
||||
@ -33,7 +33,7 @@ class TestClientPlayback:
|
||||
with mock.patch(RP) as rp:
|
||||
assert not cp.current_thread
|
||||
cp.tick()
|
||||
rp.assert_called()
|
||||
assert rp.called
|
||||
assert cp.current_thread
|
||||
|
||||
cp.keepserving = False
|
||||
@ -41,7 +41,7 @@ class TestClientPlayback:
|
||||
cp.current_thread = None
|
||||
with mock.patch("mitmproxy.master.Master.shutdown") as sd:
|
||||
cp.tick()
|
||||
sd.assert_called()
|
||||
assert sd.called
|
||||
|
||||
cp.current_thread = MockThread()
|
||||
with mock.patch("mitmproxy.master.Master.shutdown") as sd:
|
||||
|
@ -1,4 +1,7 @@
|
||||
import io
|
||||
import shutil
|
||||
from unittest import mock
|
||||
|
||||
from mitmproxy.test import tflow
|
||||
from mitmproxy.test import taddons
|
||||
from mitmproxy.test import tutils
|
||||
@ -7,8 +10,6 @@ from mitmproxy.addons import dumper
|
||||
from mitmproxy import exceptions
|
||||
from mitmproxy.tools import dump
|
||||
from mitmproxy import http
|
||||
import shutil
|
||||
import mock
|
||||
|
||||
|
||||
def test_configure():
|
||||
|
@ -1,4 +1,4 @@
|
||||
import mock
|
||||
from unittest import mock
|
||||
from mitmproxy import log
|
||||
from mitmproxy.addons import eventstore
|
||||
|
||||
|
@ -3,7 +3,7 @@ from os.path import normpath
|
||||
from mitmproxy.tools.console import pathedit
|
||||
from mitmproxy.test import tutils
|
||||
|
||||
from mock import patch
|
||||
from unittest.mock import patch
|
||||
|
||||
|
||||
class TestPathCompleter:
|
||||
|
@ -1,4 +1,4 @@
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from mitmproxy import contentviews
|
||||
from mitmproxy.exceptions import ContentViewException
|
||||
|
@ -1,6 +1,7 @@
|
||||
import os
|
||||
import sys
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
if os.name == "nt":
|
||||
m = mock.Mock()
|
||||
m.__version__ = "1.1.1"
|
||||
|
@ -1,5 +1,5 @@
|
||||
from io import BytesIO
|
||||
from mock import Mock
|
||||
from unittest.mock import Mock
|
||||
import pytest
|
||||
|
||||
from mitmproxy import exceptions
|
||||
|
@ -1,9 +1,9 @@
|
||||
import time
|
||||
from unittest import mock
|
||||
|
||||
from mitmproxy.net.http import cookies
|
||||
from mitmproxy.test.tutils import raises
|
||||
|
||||
import mock
|
||||
|
||||
cookie_pairs = [
|
||||
[
|
||||
|
@ -1,4 +1,4 @@
|
||||
import mock
|
||||
from unittest import mock
|
||||
import pytest
|
||||
|
||||
from mitmproxy.net.http import encoding
|
||||
|
@ -5,8 +5,8 @@ import socket
|
||||
import random
|
||||
import os
|
||||
import threading
|
||||
import mock
|
||||
import pytest
|
||||
from unittest import mock
|
||||
from OpenSSL import SSL
|
||||
|
||||
from mitmproxy import certs
|
||||
|
@ -1,6 +1,6 @@
|
||||
from threading import Thread, Event
|
||||
|
||||
from mock import Mock
|
||||
from unittest.mock import Mock
|
||||
|
||||
from mitmproxy import controller
|
||||
import queue
|
||||
|
@ -1,6 +1,7 @@
|
||||
import io
|
||||
from unittest.mock import patch
|
||||
|
||||
from mitmproxy.test import tflow
|
||||
from mock import patch
|
||||
|
||||
from mitmproxy import flowfilter
|
||||
from . import tutils as ttutils
|
||||
|
@ -1,6 +1,6 @@
|
||||
from mitmproxy.test import tflow
|
||||
import os
|
||||
import mock
|
||||
from unittest import mock
|
||||
import argparse
|
||||
from OpenSSL import SSL
|
||||
|
||||
|
@ -2,7 +2,7 @@ import os
|
||||
import socket
|
||||
import time
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from mitmproxy.test import tutils
|
||||
from mitmproxy import controller
|
||||
|
@ -1,15 +1,16 @@
|
||||
import json as _json
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
import tornado.testing
|
||||
from tornado import httpclient
|
||||
from tornado import websocket
|
||||
|
||||
from mitmproxy import exceptions
|
||||
from mitmproxy import proxy
|
||||
from mitmproxy import options
|
||||
from mitmproxy.test import tflow
|
||||
from mitmproxy.tools.web import app
|
||||
from mitmproxy.tools.web import master as webmaster
|
||||
from tornado import httpclient
|
||||
from tornado import websocket
|
||||
|
||||
|
||||
def json(resp: httpclient.HTTPResponse):
|
||||
|
@ -1,7 +1,6 @@
|
||||
import io
|
||||
import typing
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
import pytest
|
||||
|
||||
from mitmproxy.utils import typecheck
|
||||
|
@ -1,5 +1,5 @@
|
||||
import io
|
||||
import mock
|
||||
from unittest import mock
|
||||
from mitmproxy.utils import version_check
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import io
|
||||
from mock import Mock
|
||||
from unittest.mock import Mock
|
||||
import pytest
|
||||
|
||||
from mitmproxy.net import http
|
||||
|
@ -1,5 +1,5 @@
|
||||
import io
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from pathod import pathoc_cmdline as cmdline
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from pathod import pathod_cmdline as cmdline
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import mock
|
||||
from unittest import mock
|
||||
import codecs
|
||||
|
||||
import hyperframe
|
||||
|
Loading…
Reference in New Issue
Block a user