Exemple #1
0
    def test_member_join_is_idempotent(self, db_session, group, users):
        svc = GroupService(db_session, users.get)

        svc.member_join(group, 'theresa')
        svc.member_join(group, 'theresa')

        assert group.members.count(users['theresa']) == 1
Exemple #2
0
    def test_member_join_is_idempotent(self, db_session, group, users):
        svc = GroupService(db_session, users.get)

        svc.member_join(group, 'theresa')
        svc.member_join(group, 'theresa')

        assert group.members.count(users['theresa']) == 1
Exemple #3
0
    def test_member_join_publishes_join_event(self, db_session, group, users):
        publish = mock.Mock(spec_set=[])
        svc = GroupService(db_session, users.get, publish=publish)
        group.pubid = 'abc123'

        svc.member_join(group, 'theresa')

        publish.assert_called_once_with('group-join', 'abc123', 'theresa')
Exemple #4
0
    def test_member_join_publishes_join_event(self, db_session, group, users):
        publish = mock.Mock(spec_set=[])
        svc = GroupService(db_session, users.get, publish=publish)
        group.pubid = 'abc123'

        svc.member_join(group, 'theresa')

        publish.assert_called_once_with('group-join', 'abc123', 'theresa')
Exemple #5
0
    def test_member_join_adds_user_to_group(self, db_session, group, users):
        svc = GroupService(db_session, users.get)

        svc.member_join(group, 'theresa')

        assert users['theresa'] in group.members
Exemple #6
0
    def test_member_join_adds_user_to_group(self, db_session, group, users):
        svc = GroupService(db_session, users.get)

        svc.member_join(group, 'theresa')

        assert users['theresa'] in group.members