Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ckanext-odsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Transparenzportal
ckanext-odsh
Commits
9305cad3
Commit
9305cad3
authored
Oct 28, 2019
by
Benjamin Becker
Browse files
Options
Downloads
Patches
Plain Diff
adds unit tests, bugfix for test_checksum.py
parent
08b73de0
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ckanext/odsh/tests_tpsh/test_checksum.py
+2
-2
2 additions, 2 deletions
ckanext/odsh/tests_tpsh/test_checksum.py
ckanext/odsh/tests_tpsh/test_password_validation.py
+35
-0
35 additions, 0 deletions
ckanext/odsh/tests_tpsh/test_password_validation.py
with
37 additions
and
2 deletions
ckanext/odsh/tests_tpsh/test_checksum.py
+
2
−
2
View file @
9305cad3
from
mock
import
patch
,
mock_open
from
mock
import
patch
,
mock_open
import
nose.tools
as
nt
import
nose.tools
as
nt
from
ckanext.odsh.lib.uploader
import
_raise_validation_error_if_hash_values_differ
,
_
calculate_hash
from
ckanext.odsh.lib.uploader
import
_raise_validation_error_if_hash_values_differ
,
calculate_hash
import
ckantoolkit
as
ct
import
ckantoolkit
as
ct
import
ckan.logic
as
logic
import
ckan.logic
as
logic
import
hashlib
import
hashlib
...
@@ -51,7 +51,7 @@ class testHashException(object):
...
@@ -51,7 +51,7 @@ class testHashException(object):
# md5sum test.pdf
# md5sum test.pdf
expected_hash_pdf
=
'
66123edf64fabf1c073fc45478bf4a57
'
expected_hash_pdf
=
'
66123edf64fabf1c073fc45478bf4a57
'
with
open
(
dir_path
+
'
/resources/test.pdf
'
)
as
f
:
with
open
(
dir_path
+
'
/resources/test.pdf
'
)
as
f
:
hash
=
_
calculate_hash
(
f
)
hash
=
calculate_hash
(
f
)
nt
.
assert_equal
(
hash
,
expected_hash_pdf
)
nt
.
assert_equal
(
hash
,
expected_hash_pdf
)
...
...
This diff is collapsed.
Click to expand it.
ckanext/odsh/tests_tpsh/test_password_validation.py
0 → 100644
+
35
−
0
View file @
9305cad3
# encoding: utf-8
import
nose.tools
as
nt
from
ckanext.odsh.logic.action
import
check_password
class
Test_PasswordValidation
(
object
):
@staticmethod
def
assert_password_invalid
(
password
):
assert
not
check_password
(
password
)
@staticmethod
def
assert_password_valid
(
password
):
assert
check_password
(
password
)
def
test_valid_password
(
self
):
self
.
assert_password_valid
(
'
Passwort1 :) :P :D
'
)
def
test_umlaute
(
self
):
self
.
assert_password_valid
(
'
Pässword
'
)
def
test_no_uppercase
(
self
):
self
.
assert_password_invalid
(
'
passwort1
'
)
def
test_no_lowercase
(
self
):
self
.
assert_password_invalid
(
'
PASSWORT1
'
)
def
test_no_letters
(
self
):
self
.
assert_password_invalid
(
'
37459073245!!?===))/=$§äüöÄÜÖ
'
)
def
test_only_letters
(
self
):
self
.
assert_password_invalid
(
'
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
'
)
def
test_to_short
(
self
):
self
.
assert_password_invalid
(
'
Pw123
'
)
\ No newline at end of file
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