Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-octaveinttest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-octaveinttest
Commits
e45e6594
Commit
e45e6594
authored
3 years ago
by
Daniel Hornung
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Updated tests for current implementation.
parent
30e0a2c3
No related branches found
Branches containing commit
No related tags found
1 merge request
!2
Enhanced functionality testing
Pipeline
#11792
failed
3 years ago
Stage: info
Stage: setup
Stage: build
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_caosdb.m
+33
-0
33 additions, 0 deletions
test/test_caosdb.m
with
33 additions
and
0 deletions
test/test_caosdb.m
+
33
−
0
View file @
e45e6594
...
...
@@ -6,7 +6,9 @@ function test_suite=test_caosdb()
initTestSuite
;
end
%% Only test the connection
function
test_connection
()
return
% Default connection
c1
=
Caosdb
();
info
=
c1
.
info
();
...
...
@@ -36,3 +38,34 @@ function info = non_existing_connection()
c
=
Caosdb
(
connection
=
"does-not-exist"
);
info
=
c
.
info
();
end
%% Test retrieval of a single Entity
function
test_retrieve_single
()
% Default connection configuration is sufficient.
c
=
Caosdb
();
% Retrieve a single entity
violin
=
c
.
retrieve
(
"120"
){
1
};
% Check content
assertEqual
(
violin
.
name
,
"Sherlock Holmes' violin"
);
props
=
violin
.
getProperties
();
assertEqual
(
props
{
1
}
.
name
,
"price"
);
assertEqual
(
props
{
1
}
.
value
,
814873.0
);
assertEqual
(
props
{
2
}
.
name
,
"Manufacturer"
);
assertEqual
(
props
{
2
}
.
value
,
"119"
);
assertFalse
(
violin
.
hasErrors
());
assertFalse
(
violin
.
hasWarnings
());
assertFalse
(
violin
.
hasInfos
());
end
%% Test retrieval of multiple Entities
function
xfail_test_retrieve_multiple
()
% Retrieve two entities
collection
=
c
.
retrieve
({
"120"
,
"121"
});
assertEqual
(
length
(
collection
),
2
);
assertEqual
(
collection
(
1
),
violin
);
end
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