def test_stat_schema_distinct(self, *args):
        schema_vos = SchemaFactory.build_batch(10,
                                               repository=self.repository_vo,
                                               domain_id=self.domain_id)
        list(map(lambda vo: vo.save(), schema_vos))

        params = {
            'domain_id': self.domain_id,
            'repository_id': self.repository_vo.repository_id,
            'query': {
                'distinct': 'name',
                'page': {
                    'start': 3,
                    'limit': 4
                }
            }
        }

        self.transaction.method = 'stat'
        schema_svc = SchemaService(transaction=self.transaction)
        values = schema_svc.stat(params)
        StatisticsInfo(values)

        print_data(values, 'test_stat_schema_distinct')
    def test_stat_schema(self, *args):
        schema_vos = SchemaFactory.build_batch(10,
                                               repository=self.repository_vo,
                                               domain_id=self.domain_id)
        list(map(lambda vo: vo.save(), schema_vos))

        params = {
            'domain_id': self.domain_id,
            'repository_id': self.repository_vo.repository_id,
            'query': {
                'aggregate': [{
                    'group': {
                        'keys': [{
                            'key': 'name',
                            'name': 'Schema'
                        }],
                        'fields': [{
                            'operator': 'count',
                            'name': 'Count'
                        }]
                    }
                }, {
                    'sort': {
                        'key': 'Count',
                        'desc': True
                    }
                }]
            }
        }

        self.transaction.method = 'stat'
        schema_svc = SchemaService(transaction=self.transaction)
        values = schema_svc.stat(params)
        StatisticsInfo(values)

        print_data(values, 'test_stat_schema')