aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-16 05:29:39 +0200
committerdec05eba <dec05eba@protonmail.com>2020-08-18 23:25:46 +0200
commitc0574f16ca7960a3301230ba36ba96148818e229 (patch)
tree120eb7a3346adb772c6df015dfd8257e418eb5dd /tests
parentaa07b493ac6259e3ed0c42b60fca1f84ee09799f (diff)
Add method to get user groups
Diffstat (limited to 'tests')
-rw-r--r--tests/main.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/main.cpp b/tests/main.cpp
index 5374c2d..dd56164 100644
--- a/tests/main.cpp
+++ b/tests/main.cpp
@@ -241,6 +241,14 @@ int main()
database.storeUserWithoutNodes("anotherUser", password);
if(!database.doesStoredUserExist("anotherUser"))
fail("Added user 'anotherUser' to database without any nodes, but it doesn't seem to be stored");
+
+ auto adminUserGroups = database.getUserGroups(*databaseNode.getRequestHash(), adminUserKey->getPublicKey());
+ if(adminUserGroups.size() != 1 || adminUserGroups[0].getView() != databaseCreateResponse->getNodeAdminGroupId()->getView())
+ fail("Admin group doesn't match group stored in database");
+
+ auto userGroups = database.getUserGroups(*databaseNode.getRequestHash(), localUserKeyPair.getPublicKey());
+ if(userGroups.size() != 1 || userGroups[0].getView() != databaseCreateResponse->getNodeAdminGroupId()->getView())
+ fail("User group doesn't match group stored in database");
}
Log::debug("Callback works when adding data while connected, now testing to reconnect and check if data remains...");
{