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
be7d15aa
Commit
be7d15aa
authored
3 years ago
by
Henry Luetcke
Committed by
Adam Laskowski
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
work on test function
parent
9501848b
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
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
obi_test.m
+24
-3
24 additions, 3 deletions
obi_test.m
with
24 additions
and
3 deletions
obi_test.m
+
24
−
3
View file @
be7d15aa
function
pass
=
obi_test
function
pass
=
obi_test
(
varargin
)
%obi_test Testing function for the Matlab openBIS Toolbox
%obi_test Testing function for the Matlab openBIS Toolbox
% This function runs a few tests for the Matlab openBIS Toolbox. It
% This function runs a few tests for the Matlab openBIS Toolbox. It
% returns true if all the tests pass successfully and fasle otherwise.
% returns true if all the tests pass successfully and fasle otherwise.
% Input argumtents (all optional):
% teardown ... delete everything at the end (true)
pass
=
true
;
pass
=
true
;
if
nargin
==
1
teardown
=
varargin
{
1
};
else
teardown
=
true
;
end
%% 0. Check if pyversion is setup correctly
%% 0. Check if pyversion is setup correctly
%% 1. Login to openBIS
%% 1. Login to openBIS
...
@@ -22,7 +30,15 @@ spaces = obi.get_spaces();
...
@@ -22,7 +30,15 @@ spaces = obi.get_spaces();
assert
(
any
(
ismember
(
spaces
.
code
,
space_name
)),
'Space has not been created'
);
assert
(
any
(
ismember
(
spaces
.
code
,
space_name
)),
'Space has not been created'
);
%% 3. Create project for test
%% 3. Create project for test
project_name
=
'TESTING_PROJECT'
;
try
project
=
obi
.
new_project
(
space
,
project_name
,
'a project for tests of the Matlab openBIS Toolbox'
);
catch
disp
(
'Could not create requested project'
)
rethrow
(
lasterror
)
end
projects
=
obi
.
get_projects
(
space_name
,
project_name
);
assert
(
any
(
ismember
(
projects
.
identifier
,
sprintf
(
'/%s/%s'
,
space_name
,
project_name
))),
'Project has not been created'
);
%% 4. Create experiment for test
%% 4. Create experiment for test
...
@@ -34,7 +50,12 @@ assert(any(ismember(spaces.code, space_name)), 'Space has not been created');
...
@@ -34,7 +50,12 @@ assert(any(ismember(spaces.code, space_name)), 'Space has not been created');
%% 7. Tear-down (delete everything, optional)
%% 7. Tear-down (delete everything, optional)
if
teardown
% delete project
obi
.
delete_project
(
project_name
,
'created by Matlab-openBIS toolbox test function'
)
% delete space
obi
.
delete_space
(
space
,
'created by Matlab-openBIS toolbox test function'
)
end
%% 8. Logout
%% 8. Logout
obi
.
logout
()
obi
.
logout
()
...
...
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