Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
python-cellframe
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
3
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cellframe
python-cellframe
Commits
d0d55258
Commit
d0d55258
authored
5 years ago
by
alexey.stratulat
Browse files
Options
Downloads
Patches
Plain Diff
[+] Added return value depending on whether the test passed.
parent
a32f7a85
No related branches found
No related tags found
1 merge request
!26
Support 3689
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
test/test_b58.py
+3
-2
3 additions, 2 deletions
test/test_b58.py
test/test_b64.py
+2
-0
2 additions, 0 deletions
test/test_b64.py
test/test_iaes256_cbc.py
+3
-10
3 additions, 10 deletions
test/test_iaes256_cbc.py
test/test_oaes.py
+1
-9
1 addition, 9 deletions
test/test_oaes.py
with
9 additions
and
21 deletions
test/test_b58.py
+
3
−
2
View file @
d0d55258
...
...
@@ -15,8 +15,9 @@ print ("Decoded data: \t")
print
(
decrypt
)
out_data
=
pickle
.
loads
(
decrypt
)
if
s
==
out_data
:
print
(
"
TEST 1. Encode/Decode base
64
done
"
)
print
(
"
TEST 1. Encode/Decode base
58
done
"
)
else
:
print
(
"
TEST 1. Encode/Decode base64 faild
"
)
print
(
"
TEST 1. Encode/Decode base58 faild
"
)
sys
.
exit
(
1
)
sys
.
exit
(
0
)
This diff is collapsed.
Click to expand it.
test/test_b64.py
+
2
−
0
View file @
d0d55258
...
...
@@ -14,6 +14,7 @@ if bytes(s, "utf-8") == decrypt:
print
(
"
TEST 1. Encode/Decode base64 done
"
)
else
:
print
(
"
TEST 1. Encode/Decode base64 faild
"
)
sys
.
exit
(
1
)
print
(
"
Test Base64 URLSAFE
"
)
u
=
"
http://kelvin.foundation/
"
...
...
@@ -23,6 +24,7 @@ if bytes(u, "utf-8") == decrypt_u:
print
(
"
TEST 2. Encode/Decode base64 urlsafe done
"
)
else
:
print
(
"
TEST 2. Encode/Decode base64 urlsafe faild
"
)
sys
.
exit
(
2
)
sys
.
exit
(
0
)
This diff is collapsed.
Click to expand it.
test/test_iaes256_cbc.py
+
3
−
10
View file @
d0d55258
...
...
@@ -17,19 +17,12 @@ decrypt = crypto.decryptIAES256CBCFast(key_id, enc, len(enc), 2048)
print
(
decrypt
)
if
bytes
(
s
,
"
utf-8
"
)
=
=
decrypt
:
if
bytes
(
s
,
"
utf-8
"
)
!
=
decrypt
:
print
(
"
TEST 1. Encode/Decode IAES256 CBC FAST done
"
)
else
:
print
(
"
TEST 1. Encode/Decode IAES256 CBC FAST faild
"
)
sys
.
exit
(
1
)
#print ("Test Base64 URLSAFE")
#u = "http://kelvin.foundation/"
#crypt_u = crypto.encodeBase64(bytes(u, "utf-8"), 2)
#decrypt_u = crypto.decodeBase64(crypt_u)
#if bytes(u, "utf-8") == decrypt_u:
# print ("TEST 2. Encode/Decode base64 urlsafe done")
#else:
# print ("TEST 2. Encode/Decode base64 urlsafe faild")
#
sys
.
exit
(
0
)
This diff is collapsed.
Click to expand it.
test/test_oaes.py
+
1
−
9
View file @
d0d55258
...
...
@@ -20,15 +20,7 @@ if bytes(s, "utf-8") == decrypt:
print
(
"
TEST 1. Encode/Decode OAES FAST done
"
)
else
:
print
(
"
TEST 1. Encode/Decode OAES CBC FAST faild
"
)
sys
.
exit
(
1
)
#print ("Test Base64 URLSAFE")
#u = "http://kelvin.foundation/"
#crypt_u = crypto.encodeBase64(bytes(u, "utf-8"), 2)
#decrypt_u = crypto.decodeBase64(crypt_u)
#if bytes(u, "utf-8") == decrypt_u:
# print ("TEST 2. Encode/Decode base64 urlsafe done")
#else:
# print ("TEST 2. Encode/Decode base64 urlsafe faild")
#
sys
.
exit
(
0
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment