Merge "Drop pycrypto from tests dependencies"

This commit is contained in:
Jenkins 2017-07-28 04:11:42 +00:00 committed by Gerrit Code Review
commit 13e0ed08fb
3 changed files with 4 additions and 6 deletions

View File

@ -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

View File

@ -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(

View File

@ -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])