예제 #1
0
    def test_pillow_deletion(self):
        user_id, group = self.test_pillow()
        group.soft_delete()

        # send to kafka
        since = get_current_kafka_seq(GROUP)
        producer.send_change(GROUP, _group_to_change_meta(group.to_json()))

        pillow = get_group_to_user_pillow()
        pillow.process_changes(since=since, forever=False)

        # confirm removed in elasticsearch
        self.es_client.indices.refresh(USER_INDEX)
        _assert_es_user_and_groups(self, self.es_client, user_id, [], [])
    def test_pillow_deletion(self):
        user_id, group = self.test_pillow()
        group.soft_delete()

        # send to kafka
        since = get_topic_offset(GROUP)
        producer.send_change(GROUP, _group_to_change_meta(group.to_json()))

        pillow = get_group_to_user_pillow()
        pillow.process_changes(since=since, forever=False)

        # confirm removed in elasticsearch
        self.es_client.indices.refresh(USER_INDEX)
        _assert_es_user_and_groups(self, self.es_client, user_id, [], [])
예제 #3
0
    def test_pillow(self):
        user_id = uuid.uuid4().hex
        domain = 'dbtest-group-user'
        _create_es_user(self.es_client, user_id, domain)
        _assert_es_user_and_groups(self, self.es_client, user_id, None, None)

        # create and save a group
        group = Group(domain=domain, name='g1', users=[user_id])
        group.save()

        # send to kafka
        since = get_current_kafka_seq(GROUP)
        producer.send_change(GROUP, _group_to_change_meta(group.to_json()))

        # process using pillow
        pillow = get_group_to_user_pillow()
        pillow.process_changes(since=since, forever=False)

        # confirm updated in elasticsearch
        self.es_client.indices.refresh(USER_INDEX)
        _assert_es_user_and_groups(self, self.es_client, user_id, [group._id], [group.name])
        return user_id, group
예제 #4
0
    def test_pillow(self):
        user_id = uuid.uuid4().hex
        domain = 'dbtest-group-user'
        _create_es_user(self.es_client, user_id, domain)
        _assert_es_user_and_groups(self, self.es_client, user_id, None, None)

        # create and save a group
        group = Group(domain=domain, name='g1', users=[user_id])
        group.save()

        # send to kafka
        since = get_topic_offset(GROUP)
        producer.send_change(GROUP, _group_to_change_meta(group.to_json()))

        # process using pillow
        pillow = get_group_to_user_pillow()
        pillow.process_changes(since=since, forever=False)

        # confirm updated in elasticsearch
        self.es_client.indices.refresh(USER_INDEX)
        _assert_es_user_and_groups(self, self.es_client, user_id, [group._id], [group.name])
        return user_id, group