Skip to content

Commit

Permalink
more specific asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
helylle committed Oct 4, 2024
1 parent 1edec46 commit b313792
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/eduid/graphdb/tests/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_create_db(self) -> None:
with self.neo4jdb.driver.session() as session:
result = session.run("MATCH (n {name: $name})RETURN n.testing", name="test node")
single = result.single()
assert single
assert single is not None
self.assertTrue(single.value())


Expand All @@ -39,5 +39,5 @@ def test_base_db(self) -> None:
with test_db._db.driver.session() as session:
result = session.run("MATCH (n {name: $name})RETURN n.testing", name="test node")
single = result.single()
assert single
assert single is not None
self.assertTrue(single.value())
10 changes: 5 additions & 5 deletions src/eduid/graphdb/tests/test_groupdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def test_create_group_with_user_member(self) -> None:
assert 1 == self.group_db.db.count_nodes(label="User")

post_save_group = self.group_db.get_group(identifier="test1")
assert post_save_group
assert post_save_group is not None
post_save_user = post_save_group.member_users[0]
self._assert_user(user, post_save_user)

Expand All @@ -126,7 +126,7 @@ def test_create_group_with_group_member(self) -> None:
assert 2 == self.group_db.db.count_nodes(label="Group")

post_save_group = self.group_db.get_group(identifier="test1")
assert post_save_group
assert post_save_group is not None
post_save_member_group = post_save_group.member_groups[0]
self._assert_group(member_group, post_save_member_group)

Expand All @@ -146,7 +146,7 @@ def test_create_group_with_group_member_and_user_owner(self) -> None:
assert 2 == self.group_db.db.count_nodes(label="Group")

post_save_group = self.group_db.get_group(identifier="test1")
assert post_save_group
assert post_save_group is not None
post_save_member_group = post_save_group.member_groups[0]
self._assert_group(member_group, post_save_member_group)

Expand Down Expand Up @@ -372,7 +372,7 @@ def test_remove_user_from_group(self) -> None:
assert post_remove_group.has_member(member_user2.identifier) is True

get_group = self.group_db.get_group(identifier="test1")
assert get_group
assert get_group is not None
assert get_group.has_member(member_user1.identifier) is False
assert get_group.has_member(member_user2.identifier) is True

Expand All @@ -399,6 +399,6 @@ def test_remove_group_from_group(self) -> None:
assert post_remove_group.has_member(member_user1.identifier) is True

get_group = self.group_db.get_group(identifier=group.identifier)
assert get_group
assert get_group is not None
assert get_group.has_member(member_group1.identifier) is False
assert get_group.has_member(member_user1.identifier) is True

0 comments on commit b313792

Please sign in to comment.