Skip to content
Snippets Groups Projects
Commit 17dce8f0 authored by Adam Laskowski's avatar Adam Laskowski
Browse files

SSDM-13735: investigating failing pybis tests

parent 77e978a7
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
...@@ -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']
...@@ -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 re import time
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))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment