From 35cd58608afd6ec533a459bc92842213c9480ed8 Mon Sep 17 00:00:00 2001 From: alaskowski <alaskowski@ethz.ch> Date: Tue, 18 Jul 2023 09:58:26 +0200 Subject: [PATCH] SSDM-13735: investigating failing pybis tests --- .../src/python/tests/test_dataset.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/api-openbis-python3-pybis/src/python/tests/test_dataset.py b/api-openbis-python3-pybis/src/python/tests/test_dataset.py index 1e7866f2601..291ebd55ee8 100644 --- a/api-openbis-python3-pybis/src/python/tests/test_dataset.py +++ b/api-openbis-python3-pybis/src/python/tests/test_dataset.py @@ -26,10 +26,11 @@ from pybis.things import Things def test_get_datasets(space): # test paging o = space.openbis - + testfile_path = os.path.join(os.path.dirname(__file__), "testfile") dataset = o.new_dataset( type="RAW_DATA", experiment="/DEFAULT/DEFAULT/DEFAULT", + files=[testfile_path], props={"$name": "some good name"}, ) dataset.save() @@ -41,6 +42,15 @@ def test_get_datasets(space): finally: dataset.delete() +def test_create_datasets_no_file(space): + o = space.openbis + with pytest.raises(Exception) as exc: + o.new_dataset( + type="RAW_DATA", + experiment="/DEFAULT/DEFAULT/DEFAULT", + props={"$name": "some good name"}, + ) + assert str(exc.value) == "please provide at least one file" def test_create_delete_dataset(space): timestamp = time.strftime("%a_%y%m%d_%H%M%S").upper() -- GitLab