aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordec05eba <0xdec05eba@gmail.com>2018-05-16 05:29:39 +0200
committerdec05eba <0xdec05eba@gmail.com>2018-05-16 05:29:41 +0200
commit16a9b3e33cd4e377417dcc785be7e19bf71e18b9 (patch)
tree40fc796056ee4b7ecd4be72e97ca52d8049e2c97 /tests
parent04d872f415d749778194cf415b36b2021e5896fc (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...");
{