Skip to content
Snippets Groups Projects

Add tests for user creation/deletion/retrieval

Merged Timm Fitschen requested to merge f-dot-in-username into dev
+ 8
5
@@ -18,10 +18,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#include "caosdb/acm/user.h" // for User
#include "caosdb/connection.h" // for Connection, VersionInfo, path
#include "caosdb/exceptions.h" // for TransactionError
#include "caosdb_test_utility.h" // for EXPECT_THROW_MESSAGE
#include "caosdb/acm/user.h" // for User
#include "caosdb/connection.h" // for Connection, VersionInfo, path
#include "caosdb/exceptions.h" // for TransactionError
#include "caosdb_test_utility.h" // for EXPECT_THROW_MESSAGE
#include <gtest/gtest-message.h> // for Message
#include <gtest/gtest-test-part.h> // for SuiteApiResolver, TestPartR...
#include <gtest/gtest_pred_impl.h> // for Test, TestInfo, TEST, EXPEC...
@@ -60,7 +60,10 @@ TEST(test_user, test_create_single_user_success) {
auto re = connection->RetrieveSingleUser("CaosDB", "user1");
EXPECT_EQ(re.GetName(), user.GetName());
connection->DeleteSingleUser("CaosDB", "user1");
EXPECT_THROW_MESSAGE(connection->RetrieveSingleUser("CaosDB", "user1"), caosdb::exceptions::Exception, "The attempt to execute this transaction was not successful because an error occured in the transport or RPC protocol layer. Original error: 5 - This account does not exist.");
EXPECT_THROW_MESSAGE(
connection->RetrieveSingleUser("CaosDB", "user1"), caosdb::exceptions::Exception,
"The attempt to execute this transaction was not successful because an error occured in the "
"transport or RPC protocol layer. Original error: 5 - This account does not exist.");
}
} // namespace caosdb::connection
Loading