Skip to content

Commit

Permalink
fixed mock import and removed obsolete sys.version check
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Lyssenko committed Jun 12, 2023
1 parent 8906eb7 commit ffec330
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion test/lib/testlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import string
import unittest

from mock import MagicMock as Mock
from unittest.mock import MagicMock as Mock

from pyeapi.client import Node

Expand Down
2 changes: 1 addition & 1 deletion test/system/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
sys.path.append(os.path.join(os.path.dirname(__file__), '../lib'))

from testlib import random_int, random_string, get_fixture
from mock import patch
from unittest.mock import patch

import pyeapi.client
import pyeapi.eapilib
Expand Down
2 changes: 1 addition & 1 deletion test/unit/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

sys.path.append(os.path.join(os.path.dirname(__file__), '../lib'))

from mock import Mock, patch, call
from unittest.mock import Mock, patch, call

from testlib import get_fixture, random_string, random_int

Expand Down
2 changes: 1 addition & 1 deletion test/unit/test_eapilib.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest
import json

from mock import Mock, patch
from unittest.mock import Mock, patch

import pyeapi.eapilib

Expand Down
8 changes: 2 additions & 6 deletions test/unit/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import sys
import unittest

from mock import patch, Mock
from unittest.mock import patch, Mock
import pyeapi.utils

if sys.version_info < (3, 3):
from collections import Iterable
else:
from collections.abc import Iterable
from collections.abc import Iterable

class TestUtils(unittest.TestCase):

Expand Down

0 comments on commit ffec330

Please sign in to comment.