Exemple #1
0
    def test_20_list_x(self):
        prcs = TT.Processors(PRS)
        self.assertRaises(ValueError, prcs.list_x)
        self.assertEqual(prcs.list_x("cid"), sorted(set(p.cid() for p in PRS)))
        self.assertEqual(prcs.list_x("type"),
                         sorted(set(p.type() for p in PRS)))

        res = sorted(set(A.extensions() + B.extensions() + C.extensions()))
        self.assertEqual(prcs.list_x("extension"), res)
Exemple #2
0
 def test_12_init_with_processors(self):
     prcs = TT.Processors(PRS)
     self.assertEqual(prcs.list(), sorted(PRS,
                                          key=operator.methodcaller("cid")))
Exemple #3
0
 def test_10_init(self):
     prcs = TT.Processors()
     self.assertFalse(prcs.list())
Exemple #4
0
 def test_20_list_by_cid(self):
     prcs = TT.Processors(PRS)
     exp = sorted(((p.cid(), [p]) for p in PRS),
                  key=TT.operator.itemgetter(0))
     self.assertEqual(prcs.list_by_cid(), exp)