Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
Domain Data Mgmt Services
Wellbore
Wellbore Domain Services
Commits
a960bafd
Commit
a960bafd
authored
Jun 28, 2021
by
Luc Yriarte
Browse files
Moved urn decode tests
parent
63077d24
Pipeline
#48653
failed with stages
in 22 minutes and 39 seconds
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
tests/unit/bulk_persistence/bulk_id_test.py
View file @
a960bafd
...
...
@@ -19,3 +19,21 @@ import uuid
def
test_bulk_id_is_an_uuid
():
uuid
.
UUID
(
BulkId
.
new_bulk_id
())
# urn decode test
def
test_decode_urn_no_prefix
():
uuid
,
prefix
=
BulkId
.
bulk_urn_decode
(
"urn:uuid:489768d2-eee1-4a8f-ae95-7b0c30b0dcd8"
)
assert
uuid
==
"489768d2-eee1-4a8f-ae95-7b0c30b0dcd8"
assert
prefix
is
None
def
test_decode_urn_with_prefix
():
uuid
,
prefix
=
BulkId
.
bulk_urn_decode
(
"urn:myprefix:uuid:489768d2-eee1-4a8f-ae95-7b0c30b0dcd8"
)
assert
uuid
==
"489768d2-eee1-4a8f-ae95-7b0c30b0dcd8"
assert
prefix
==
'myprefix'
def
test_decode_urn_none
():
uuid
=
None
try
:
uuid
,
prefix
=
BulkId
.
bulk_urn_decode
(
None
)
except
ValueError
:
pass
assert
uuid
is
None
\ No newline at end of file
tests/unit/routers/ddms_v3/common_ddms_v3_test.py
View file @
a960bafd
...
...
@@ -23,7 +23,6 @@ from fastapi import Header, status
from
odes_storage.models
import
CreateUpdateRecordsResponse
,
Record
from
app.bulk_persistence
import
BulkId
from
app.model.osdu_model
import
Wellbore
,
Well
from
app.clients
import
SearchServiceClient
,
StorageRecordServiceClient
...
...
@@ -200,22 +199,3 @@ def test_get_record_success(client, base_url, id, record_obj):
# assert it validates the input object schema
record_obj
.
validate
(
response
.
json
())
# urn decode test
def
test_decode_urn_no_prefix
():
uuid
,
prefix
=
BulkId
.
bulk_urn_decode
(
"urn:uuid:489768d2-eee1-4a8f-ae95-7b0c30b0dcd8"
)
assert
uuid
==
"489768d2-eee1-4a8f-ae95-7b0c30b0dcd8"
assert
prefix
is
None
def
test_decode_urn_with_prefix
():
uuid
,
prefix
=
BulkId
.
bulk_urn_decode
(
"urn:myprefix:uuid:489768d2-eee1-4a8f-ae95-7b0c30b0dcd8"
)
assert
uuid
==
"489768d2-eee1-4a8f-ae95-7b0c30b0dcd8"
assert
prefix
==
'myprefix'
def
test_decode_urn_none
():
uuid
=
None
try
:
uuid
,
prefix
=
BulkId
.
bulk_urn_decode
(
None
)
except
ValueError
:
pass
assert
uuid
is
None
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment