Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
faaacfd4
Commit
faaacfd4
authored
6 years ago
by
yvesn
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-7140: fixing tests
parent
8312f7fb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
obis/src/python/obis/dm/data_mgmt_test.py
+24
-19
24 additions, 19 deletions
obis/src/python/obis/dm/data_mgmt_test.py
with
24 additions
and
19 deletions
obis/src/python/obis/dm/data_mgmt_test.py
+
24
−
19
View file @
faaacfd4
...
...
@@ -169,25 +169,30 @@ def test_child_data_set(tmpdir):
def
test_external_dms_code_and_address
(
tmpdir
):
# given
dm
=
shared_dm
(
tmpdir
)
prepare_registration_expectations
(
dm
)
obis_sync
=
data_mgmt
.
OpenbisSync
(
dm
)
set_registration_configuration
(
dm
)
user
=
obis_sync
.
user
()
hostname
=
socket
.
gethostname
()
expected_edms_id
=
obis_sync
.
external_dms_id
()
result
=
obis_sync
.
git_wrapper
.
git_top_level_path
()
assert
result
.
failure
()
==
False
edms_path
,
folder
=
os
.
path
.
split
(
result
.
output
)
path_hash
=
hashlib
.
sha1
(
edms_path
.
encode
(
"
utf-8
"
)).
hexdigest
()[
0
:
8
]
if
expected_edms_id
is
None
:
expected_edms_id
=
"
{}-{}-{}
"
.
format
(
user
,
hostname
,
path_hash
).
upper
()
# when
result
=
obis_sync
.
get_or_create_external_data_management_system
();
# then
assert
result
.
failure
()
==
False
dm
.
openbis
.
get_external_data_management_system
.
assert_called_with
(
expected_edms_id
)
tmp_dir_path
=
str
(
tmpdir
)
with
data_mgmt
.
cd
(
tmp_dir_path
):
# given
dm
=
shared_dm
(
tmp_dir_path
)
prepare_registration_expectations
(
dm
)
obis_sync
=
data_mgmt
.
OpenbisSync
(
dm
)
set_registration_configuration
(
dm
)
user
=
obis_sync
.
user
()
hostname
=
socket
.
gethostname
()
expected_edms_id
=
obis_sync
.
external_dms_id
()
result
=
obis_sync
.
git_wrapper
.
git_init
()
assert
result
.
failure
()
==
False
result
=
obis_sync
.
git_wrapper
.
git_top_level_path
()
assert
result
.
failure
()
==
False
edms_path
,
folder
=
os
.
path
.
split
(
result
.
output
)
path_hash
=
hashlib
.
sha1
(
edms_path
.
encode
(
"
utf-8
"
)).
hexdigest
()[
0
:
8
]
if
expected_edms_id
is
None
:
expected_edms_id
=
"
{}-{}-{}
"
.
format
(
user
,
hostname
,
path_hash
).
upper
()
# when
result
=
obis_sync
.
get_or_create_external_data_management_system
();
# then
assert
result
.
failure
()
==
False
dm
.
openbis
.
get_external_data_management_system
.
assert_called_with
(
expected_edms_id
)
def
test_undo_commit_when_sync_fails
(
tmpdir
):
...
...
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