aboutsummaryrefslogtreecommitdiffstats
path: root/tests/utils.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-08-10 15:23:38 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2013-08-10 15:23:38 -0400
commitf312a5c1c9ae436fa61debfdd8eb6ba6388fea1f (patch)
tree575a97f1da75be15b8bcd26c210d4ad49247a78e /tests/utils.py
parent34c7a91c08413b92d6eec033a350d1d9423a3a9d (diff)
downloadcryptography-f312a5c1c9ae436fa61debfdd8eb6ba6388fea1f.tar.gz
cryptography-f312a5c1c9ae436fa61debfdd8eb6ba6388fea1f.tar.bz2
cryptography-f312a5c1c9ae436fa61debfdd8eb6ba6388fea1f.zip
Made the load NIST vectors test utility use bytes correctly
Diffstat (limited to 'tests/utils.py')
-rw-r--r--tests/utils.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/utils.py b/tests/utils.py
index 9fe35311..9362464e 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -1,3 +1,16 @@
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
import os.path
@@ -35,7 +48,7 @@ def load_nist_vectors(vector_data, op, fields):
# We want to test only for a particular operation
return [
- tuple(vector[1][f] for f in fields)
+ tuple(vector[1][f].encode("ascii") for f in fields)
for vector in sorted(data[op].items(), key=lambda v: v[0])
]