summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-07-28 04:11:42 +0000
committerGerrit Code Review <review@openstack.org>2017-07-28 04:11:42 +0000
commit13e0ed08fbdf3e2600b2c12da302a828862ad8db (patch)
tree24ef5f540d3141f6c5cc6fcf6a0071242b955fc3
parentc959defd0206cc61532c1a38be0d1e700a3e2238 (diff)
parentd512e4763dce57c632f6a5d602b1fc3fa6828b7f (diff)
downloadpython-troveclient-13e0ed08fbdf3e2600b2c12da302a828862ad8db.tar.gz
Merge "Drop pycrypto from tests dependencies"
-rw-r--r--test-requirements.txt1
-rw-r--r--troveclient/tests/test_modules.py4
-rw-r--r--troveclient/tests/test_utils.py5
3 files changed, 4 insertions, 6 deletions
diff --git a/test-requirements.txt b/test-requirements.txt
index b320d2c..0df6bda 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -13,6 +13,5 @@ testscenarios>=0.4 # Apache-2.0/BSD
testtools>=1.4.0 # MIT
mock>=2.0 # BSD
httplib2>=0.7.5 # MIT
-pycrypto>=2.6 # Public Domain
reno!=2.3.1,>=1.8.0 # Apache-2.0
openstackdocstheme>=1.16.0 # Apache-2.0
diff --git a/troveclient/tests/test_modules.py b/troveclient/tests/test_modules.py
index 9decb6b..9dec416 100644
--- a/troveclient/tests/test_modules.py
+++ b/troveclient/tests/test_modules.py
@@ -14,8 +14,8 @@
# under the License.
#
-import Crypto.Random
import mock
+import os
import testtools
from troveclient.v1 import modules
@@ -55,7 +55,7 @@ class TestModules(testtools.TestCase):
return path, body, mod
text_contents = "my_contents"
- binary_contents = Crypto.Random.new().read(20)
+ binary_contents = os.urandom(20)
for contents in [text_contents, binary_contents]:
self.modules._create = mock.Mock(side_effect=side_effect_func)
path, body, mod = self.modules.create(
diff --git a/troveclient/tests/test_utils.py b/troveclient/tests/test_utils.py
index aa47d21..5de10d5 100644
--- a/troveclient/tests/test_utils.py
+++ b/troveclient/tests/test_utils.py
@@ -15,7 +15,6 @@
# License for the specific language governing permissions and limitations
# under the License.
-import Crypto.Random
import os
import tempfile
import testtools
@@ -55,8 +54,8 @@ class UtilsTest(testtools.TestCase):
text_data_bytes = bytes('This is a byte stream', 'utf-8')
except TypeError:
text_data_bytes = bytes('This is a byte stream')
- random_data_str = Crypto.Random.new().read(12)
- random_data_bytes = bytearray(Crypto.Random.new().read(12))
+ random_data_str = os.urandom(12)
+ random_data_bytes = bytearray(os.urandom(12))
special_char_str = '\x00\xFF\x00\xFF\xFF\x00'
special_char_bytes = bytearray(
[ord(item) for item in special_char_str])