Skip to content
Snippets Groups Projects
Commit eee8b7a7 authored by Daniel Hornung's avatar Daniel Hornung
Browse files

ENH: Updated test.

parent 531bd4b0
No related branches found
No related tags found
1 merge request!1Integration tests for minimal functionality
Pipeline #11426 canceled
# -*- mode:conf; -*-
# local client config
test/caosdb_client.json
# Changelog #
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased] ##
### Added ###
### Changed ###
### Deprecated ###
### Removed ###
### Fixed ###
### Security ###
## [0.0.1] - 2021-XX-XX ##
### Added ###
- Minimal working example with basic connection testing.
Makefile 0 → 100644
# ** header v3.0
# This file is a part of the CaosDB Project.
#
# Copyright (C) 2021 IndiScale GmbH <info@indiscale.com>
# Copyright (C) 2021 Daniel Hornung <d.hornung@indiscale.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# ** end header
# This Makefile is a wrapper for several other scripts.
.PHONY: help
help:
@echo "Targets:"
@echo " test - run the test."
###############################################################################
# Tests #
###############################################################################
test:
cd test && octave Run_Test.m
.PHONY: test
......@@ -15,6 +15,8 @@ Integration tests for caosdb-octavelib and the caosdb-server
# Run tests
0. Create a customized `test/caosdb_client.json` (note the missing dot, this file is in
`.gitignore`) with the local location of certificates.
1. `cd test`
2. Run `octave Run_Test.m`
......
......@@ -4,7 +4,7 @@
"local-caosdb-admin": {
"host": "localhost",
"port": 8443,
"server_certificate_path": "/someplace/caosdb.cert.pem",
"server_certificate_path": "/cert/caosdb.cert.pem",
"authentication": {
"type": "plain",
"username": "admin",
......@@ -14,7 +14,7 @@
"local-caosdb": {
"host": "localhost",
"port": 8443,
"server_certificate_path": "/someplace/caosdb.cert.pem",
"server_certificate_path": "/cert/caosdb.cert.pem",
"authentication": {
"type": "plain",
"username": "admin",
......
......@@ -17,4 +17,7 @@
% along with this program. If not, see <https://www.gnu.org/licenses/>.
pkg load caosdb;
moxunit_runtests -verbose test_caosdb.m
test_result = moxunit_runtests("-verbose", "test_caosdb.m");
if not(test_result)
exit(1)
end
......@@ -16,10 +16,23 @@ function test_connection()
c2.info();
% This connection should fail
c3 = Caosdb(connection = "does-not-exist");
% c3 = Caosdb(connection = "does-not-exist");
% Error message is:
% maox_info: The ConnectionManager does not know any connection of this name.
% No connection named 'does-not-exist' present.
if moxunit_util_platform_is_octave()
assertExceptionThrown(@()c3.info());
assertExceptionThrown(@non_existing_connection);
else
assertExceptionThrown(@()c3.info(),"16");
assertExceptionThrown(@non_existing_connection,"16");
end
expected_msg = ...
strjoin(
{"maox_info: The ConnectionManager does not know any connection of this name.",
"No connection named 'does-not-exist' present."}, "\n");
assertEqual(lasterror().message, expected_msg)
end
function info = non_existing_connection()
c = Caosdb(connection = "does-not-exist");
info = c.info();
end
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