Beispiel #1
0
    def test_three(self):
        obj = Count()
        sel1 = MockEventSelection(name='sel1')
        sel2 = MockEventSelection(name='sel2')
        sel3 = MockEventSelection()
        obj.add(sel1)
        obj.add(sel2)
        obj.add(sel3)

        self.assertEqual([
            [1, 'MockEventSelection', 'sel1', 0, 0],
            [1, 'MockEventSelection', 'sel2', 0, 0],
            [1, 'MockEventSelection', '', 0, 0],
        ], obj._results)

        obj.count(pass_=[True, False])
        self.assertEqual([
            [1, 'MockEventSelection', 'sel1', 1, 1],
            [1, 'MockEventSelection', 'sel2', 0, 1],
            [1, 'MockEventSelection', '', 0, 0],
        ], obj._results)

        obj.count(pass_=[True, True, False])
        self.assertEqual([
            [1, 'MockEventSelection', 'sel1', 2, 2],
            [1, 'MockEventSelection', 'sel2', 1, 2],
            [1, 'MockEventSelection', '', 0, 1],
        ], obj._results)
Beispiel #2
0
    def test_one(self):
        obj = Count()
        sel1 = MockEventSelection(name='sel1')
        obj.add(sel1)

        self.assertEqual([
            [1, 'MockEventSelection', 'sel1', 0, 0],
        ], obj._results)

        obj.count(pass_=[True])
        self.assertEqual([
            [1, 'MockEventSelection', 'sel1', 1, 1],
        ], obj._results)

        obj.count(pass_=[False])
        self.assertEqual([
            [1, 'MockEventSelection', 'sel1', 1, 2],
        ], obj._results)
Beispiel #3
0
 def test_empty(self):
     obj = Count()
     obj.count(pass_=[])