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
4bcd2b2d
Commit
4bcd2b2d
authored
3 years ago
by
vkovtun
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-11382 Added a test.
parent
c8c874bd
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pybis/src/python/pybis/things.py
+6
-0
6 additions, 0 deletions
pybis/src/python/pybis/things.py
pybis/src/python/tests/test_dataset.py
+33
-0
33 additions, 0 deletions
pybis/src/python/tests/test_dataset.py
with
39 additions
and
0 deletions
pybis/src/python/pybis/things.py
+
6
−
0
View file @
4bcd2b2d
...
@@ -49,6 +49,12 @@ class Things():
...
@@ -49,6 +49,12 @@ class Things():
self
.
__attrs
=
attrs
self
.
__attrs
=
attrs
self
.
__props
=
props
self
.
__props
=
props
def
is_df_initialised
(
self
):
return
self
.
__df
is
not
None
def
is_objects_initialised
(
self
):
return
self
.
__objects
is
not
None
@property
@property
def
df
(
self
):
def
df
(
self
):
if
self
.
__df
is
None
and
self
.
__df_initializer
is
not
None
:
if
self
.
__df
is
None
and
self
.
__df_initializer
is
not
None
:
...
...
This diff is collapsed.
Click to expand it.
pybis/src/python/tests/test_dataset.py
+
33
−
0
View file @
4bcd2b2d
from
pybis.things
import
Things
import
json
import
json
import
random
import
random
import
re
import
re
...
@@ -105,3 +107,34 @@ def test_create_dataset_with_code(space):
...
@@ -105,3 +107,34 @@ def test_create_dataset_with_code(space):
assert
dataset
.
permId
==
timestamp
assert
dataset
.
permId
==
timestamp
dataset
.
delete
(
"
dataset creation test on {}
"
.
format
(
timestamp
))
dataset
.
delete
(
"
dataset creation test on {}
"
.
format
(
timestamp
))
def
test_things_initialization
(
space
):
data_frame_result
=
[
1
,
2
,
3
]
objects_result
=
[
4
,
5
,
6
]
def
create_data_frame
(
attrs
,
props
,
response
):
return
data_frame_result
def
create_objects
(
response
):
return
objects_result
things
=
Things
(
openbis_obj
=
None
,
entity
=
'
dataset
'
,
identifier_name
=
'
permId
'
,
start_with
=
0
,
count
=
10
,
totalCount
=
10
,
response
=
None
,
df_initializer
=
create_data_frame
,
objects_initializer
=
create_objects
)
assert
not
things
.
is_df_initialised
()
assert
not
things
.
is_objects_initialised
()
assert
things
.
df
==
data_frame_result
assert
things
.
objects
==
objects_result
assert
things
.
is_df_initialised
()
assert
things
.
is_objects_initialised
()
\ 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