mirror of
https://github.com/borgbackup/borg.git
synced 2026-06-09 00:32:37 -04:00
get rid of testsuite.mock, directly import from mock
this was left over from times when we either used mock from stdlib or pypi mock. but as we only use pypi mock now, the indirection is not needed any more.
This commit is contained in:
parent
4c668a85b6
commit
955ac9c44c
4 changed files with 5 additions and 17 deletions
|
|
@ -1,12 +1,12 @@
|
|||
from datetime import datetime, timezone
|
||||
|
||||
import msgpack
|
||||
from mock import Mock
|
||||
|
||||
from ..archive import Archive, CacheChunkBuffer, RobustUnpacker
|
||||
from ..key import PlaintextKey
|
||||
from ..helpers import Manifest
|
||||
from . import BaseTestCase
|
||||
from .mock import Mock
|
||||
|
||||
|
||||
class MockCache:
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ import time
|
|||
import unittest
|
||||
from hashlib import sha256
|
||||
|
||||
from mock import patch
|
||||
|
||||
from .. import xattr
|
||||
from ..archive import Archive, ChunkBuffer, CHUNK_MAX_EXP
|
||||
from ..archiver import Archiver
|
||||
|
|
@ -20,7 +22,6 @@ from ..helpers import Manifest
|
|||
from ..remote import RemoteRepository, PathNotAllowed
|
||||
from ..repository import Repository
|
||||
from . import BaseTestCase
|
||||
from .mock import patch
|
||||
|
||||
try:
|
||||
import llfuse
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
"""
|
||||
Mocking
|
||||
|
||||
Note: unittest.mock is broken on at least python 3.3.6 and 3.4.0.
|
||||
it silently ignores mistyped method names starting with assert_...,
|
||||
does nothing and just succeeds.
|
||||
The issue was fixed in the separately distributed "mock" lib, you
|
||||
get an AttributeError there. So, always use that one!
|
||||
|
||||
Details:
|
||||
|
||||
http://engineeringblog.yelp.com/2015/02/assert_called_once-threat-or-menace.html
|
||||
"""
|
||||
from mock import *
|
||||
|
|
@ -2,13 +2,14 @@ import os
|
|||
import shutil
|
||||
import tempfile
|
||||
|
||||
from mock import patch
|
||||
|
||||
from ..hashindex import NSIndex
|
||||
from ..helpers import Location, IntegrityError
|
||||
from ..locking import UpgradableLock
|
||||
from ..remote import RemoteRepository, InvalidRPCMethod
|
||||
from ..repository import Repository
|
||||
from . import BaseTestCase
|
||||
from .mock import patch
|
||||
|
||||
|
||||
class RepositoryTestCaseBase(BaseTestCase):
|
||||
|
|
|
|||
Loading…
Reference in a new issue