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
17dce8f0
Commit
17dce8f0
authored
1 year ago
by
Adam Laskowski
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-13735: investigating failing pybis tests
parent
77e978a7
No related branches found
No related tags found
1 merge request
!40
SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
api-openbis-python3-pybis/src/python/tests/test_dataset.py
+12
-9
12 additions, 9 deletions
api-openbis-python3-pybis/src/python/tests/test_dataset.py
api-openbis-python3-pybis/src/python/tests/test_project.py
+3
-7
3 additions, 7 deletions
api-openbis-python3-pybis/src/python/tests/test_project.py
with
15 additions
and
16 deletions
api-openbis-python3-pybis/src/python/tests/test_dataset.py
+
12
−
9
View file @
17dce8f0
...
@@ -36,7 +36,7 @@ def test_get_datasets(space):
...
@@ -36,7 +36,7 @@ def test_get_datasets(space):
dataset
.
save
()
dataset
.
save
()
try
:
try
:
current_datasets
=
o
.
get_datasets
(
start_with
=
1
,
count
=
1
)
current_datasets
=
o
.
get_datasets
(
count
=
1
)
assert
current_datasets
is
not
None
assert
current_datasets
is
not
None
assert
len
(
current_datasets
)
==
1
assert
len
(
current_datasets
)
==
1
finally
:
finally
:
...
@@ -326,12 +326,11 @@ def create_array_properties(openbis, code_prefix):
...
@@ -326,12 +326,11 @@ def create_array_properties(openbis, code_prefix):
def
test_dataset_array_properties
(
space
):
def
test_dataset_array_properties
(
space
):
create_array_properties
(
space
.
openbis
,
"
DATASET
"
)
create_array_properties
(
space
.
openbis
,
"
DATASET
"
)
dataset_code
=
'
TEST_ARRAY_DATASET
'
dataset_code
=
'
TEST_ARRAY_DATASET
'
dataset_type
=
space
.
openbis
.
new_dataset_type
(
dataset_type
=
space
.
openbis
.
new_dataset_type
(
code
=
dataset_code
code
=
dataset_code
)
)
dataset_type
.
save
()
dataset_type
.
save
()
...
@@ -344,10 +343,10 @@ def test_dataset_array_properties(space):
...
@@ -344,10 +343,10 @@ def test_dataset_array_properties(space):
testfile_path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"
testdir/testfile
"
)
testfile_path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"
testdir/testfile
"
)
dataset
=
space
.
openbis
.
new_dataset
(
dataset
=
space
.
openbis
.
new_dataset
(
type
=
dataset_code
,
type
=
dataset_code
,
sample
=
"
/DEFAULT/DEFAULT/DEFAULT
"
,
sample
=
"
/DEFAULT/DEFAULT/DEFAULT
"
,
files
=
[
testfile_path
],
files
=
[
testfile_path
],
props
=
{
'
dataset_array_integer
'
:
[
1
,
2
,
3
]}
props
=
{
'
dataset_array_integer
'
:
[
1
,
2
,
3
]}
)
)
dataset
.
save
()
dataset
.
save
()
...
@@ -355,10 +354,14 @@ def test_dataset_array_properties(space):
...
@@ -355,10 +354,14 @@ def test_dataset_array_properties(space):
dataset
.
props
[
'
dataset_array_real
'
]
=
[
3.1
,
2.2
,
1.3
]
dataset
.
props
[
'
dataset_array_real
'
]
=
[
3.1
,
2.2
,
1.3
]
dataset
.
props
[
'
dataset_array_string
'
]
=
[
"
aa
"
,
"
bb
"
,
"
cc
"
]
dataset
.
props
[
'
dataset_array_string
'
]
=
[
"
aa
"
,
"
bb
"
,
"
cc
"
]
dataset
.
props
[
'
dataset_array_timestamp
'
]
=
[
'
2023-05-18 11:17:03
'
,
'
2023-05-18 11:17:04
'
,
dataset
.
props
[
'
dataset_array_timestamp
'
]
=
[
'
2023-05-18 11:17:03
'
,
'
2023-05-18 11:17:04
'
,
'
2023-05-18 11:17:05
'
]
'
2023-05-18 11:17:05
'
]
dataset
.
props
[
'
dataset_json
'
]
=
"
{
\"
key
\"
: [1, 1, 1] }
"
dataset
.
props
[
'
dataset_json
'
]
=
"
{
\"
key
\"
: [1, 1, 1] }
"
dataset
.
save
()
dataset
.
save
()
assert
dataset
.
props
[
'
sample_array_integer
'
]
==
[
3
,
2
,
1
]
assert
dataset
.
props
[
'
dataset_array_integer
'
]
==
[
3
,
2
,
1
]
assert
dataset
.
props
[
'
sample_array_real
'
]
==
[
3.1
,
2.2
,
1.3
]
assert
dataset
.
props
[
'
dataset_array_real
'
]
==
[
3.1
,
2.2
,
1.3
]
assert
dataset
.
props
[
'
dataset_array_string
'
]
==
[
"
aa
"
,
"
bb
"
,
"
cc
"
]
assert
dataset
.
props
[
'
dataset_json
'
]
==
"
{
\"
key
\"
: [1, 1, 1] }
"
assert
dataset
.
props
[
'
dataset_array_timestamp
'
]
==
[
'
2023-05-18 11:17:03
'
,
'
2023-05-18 11:17:04
'
,
'
2023-05-18 11:17:05
'
]
This diff is collapsed.
Click to expand it.
api-openbis-python3-pybis/src/python/tests/test_project.py
+
3
−
7
View file @
17dce8f0
...
@@ -12,15 +12,11 @@
...
@@ -12,15 +12,11 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
#
#
import
json
import
os
import
random
import
random
import
r
e
import
tim
e
import
pytest
import
pytest
import
time
import
os
from
pybis
import
DataSet
from
pybis
import
Openbis
def
test_create_delete_project
(
space
):
def
test_create_delete_project
(
space
):
...
@@ -55,7 +51,7 @@ def test_create_project_with_attachment(space):
...
@@ -55,7 +51,7 @@ def test_create_project_with_attachment(space):
timestamp
=
time
.
strftime
(
"
%a_%y%m%d_%H%M%S
"
).
upper
()
timestamp
=
time
.
strftime
(
"
%a_%y%m%d_%H%M%S
"
).
upper
()
project_name
=
"
project_
"
+
timestamp
+
"
_
"
+
str
(
random
.
randint
(
0
,
1000
))
project_name
=
"
project_
"
+
timestamp
+
"
_
"
+
str
(
random
.
randint
(
0
,
1000
))
filename
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"
testfile
"
)
filename
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"
testdir/
testfile
"
)
if
not
os
.
path
.
exists
(
filename
):
if
not
os
.
path
.
exists
(
filename
):
raise
ValueError
(
"
File not found: {}
"
.
format
(
filename
))
raise
ValueError
(
"
File not found: {}
"
.
format
(
filename
))
...
...
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