Esempio n. 1
0
def test_2():
    cls_factories = {
        '': operation.factory,
        'cl': cl_request.factory,
        'wb': wb_request.factory,
    }
    func_factory = func.factory
    x = parse_json_conf('flows.json', cls_factories, func_factory, 'cl')

    flows = sort(x['Order'], x['Flows'])
    assert [f.name for f in flows] == ['IDP-Metadata-verify',
                                       'IDP-AuthnRedirect-verify',
                                       'IDP-AuthnRedirect-nid_email',
                                       'IDP-AuthnRedirect-nid_transient',
                                       'IDP-AuthnRedirect-nid_unspecified',
                                       'IDP-AuthnRedirect-no_nid',
                                       'IDP-AuthnPost-verify',
                                       'IDP-AuthnPost-nid_transient',
                                       'IDP-EntityCategory-coco',
                                       'IDP-EntityCategory-re_eu',
                                       'IDP-EntityCategory-re_hei',
                                       'IDP-EntityCategory-re_hei_sfs',
                                       'IDP-EntityCategory-re_nren',
                                       'IDP-EntityCategory-re_nren_sfs',
                                       'IDP-EntityCategory-rs',
                                       'IDP-Logout-soap']
Esempio n. 2
0
def test_sort():
    factories = {'': operation.factory}
    cnf = parse_json_conf('flows.json', factories, func.factory)

    flows = sort(cnf['Order'], cnf['Flows'])

    assert [f.name for f in flows] == ['AA-Dummy-Default-1', 'AA-Dummy-B',
                                       'AA-Dummy-A']
    def init_session(self, profile=None):
        _flows = sort(self.order, self.test_flows)
        self["flow_names"] = [f.name for f in _flows]

        _tests =[]
        for k in self["flow_names"]:
            try:
                kwargs = {"mti": self.test_flows[k]["mti"]}
            except KeyError:
                kwargs = {}
            _tests.append(Node(k, self.test_flows[k]["desc"], **kwargs))

        self["tests"] = _tests
        self["test_info"] = {}
        self["profile"] = profile or self.profile
        return self._dict