summaryrefslogtreecommitdiffstats
path: root/roles/lib_openshift/src/test/integration/filter_plugins/filters.py
blob: f350bd25d253b4c17bc5b1639db5a56ea5214284 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
Custom filters for use in testing
'''


class FilterModule(object):
    ''' Custom filters for use in integration testing '''

    @staticmethod
    def label_dict_to_key_value_list(label_dict):
        ''' Given a dict of labels/values, return list of key: <key> value: <value> pairs

            These are only used in integration testing.
        '''

        label_list = []
        for key in label_dict:
            label_list.append({'key': key, 'value': label_dict[key]})

        return label_list

    def filters(self):
        ''' returns a mapping of filters to methods '''
        return {
            "label_dict_to_key_value_list": self.label_dict_to_key_value_list,
        }