Exemplo n.º 1
0
 def test_violate_expectations_prediction_first(self):
     found = []
     def _note_mismatch(*params):
         found.append(params)
     arbiter = Arbiter(_note_mismatch)
     arbiter.predict(('check_name',), 'right', 'p_basis')
     arbiter.warrant(('check_name',), 'wrong', 'w_basis')
Exemplo n.º 2
0
    def test_violate_expectations_prediction_first(self):
        found = []

        def _note_mismatch(*params):
            found.append(params)

        arbiter = Arbiter(_note_mismatch)
        arbiter.predict(('check_name', ), 'right', 'p_basis')
        arbiter.warrant(('check_name', ), 'wrong', 'w_basis')
Exemplo n.º 3
0
 def test_note_leftovers(self):
     found = Set([])
     def _note_mismatch(*params):
         found.add(params)
     arbiter = Arbiter(_note_mismatch)
     arbiter.warrant(('check_name1',), 'wrong', 'w_basis')
     arbiter.predict(('check_name2',), 'right', 'p_basis')
     arbiter.note_leftovers()
     self.assert_equal(Set([(('check_name2',), 'right', 'p_basis',
                             None, 'no warrant')]),
                       found)
Exemplo n.º 4
0
    def test_note_leftovers(self):
        found = Set([])

        def _note_mismatch(*params):
            found.add(params)

        arbiter = Arbiter(_note_mismatch)
        arbiter.warrant(('check_name1', ), 'wrong', 'w_basis')
        arbiter.predict(('check_name2', ), 'right', 'p_basis')
        arbiter.note_leftovers()
        self.assert_equal(
            Set([(('check_name2', ), 'right', 'p_basis', None, 'no warrant')]),
            found)
Exemplo n.º 5
0
 def test_meet_expectations_warrant_first(self):
     arbiter = Arbiter(None)
     arbiter.warrant(('check_name',), 'right', 'w_basis')
     arbiter.predict(('check_name',), 'right', 'p_basis')
Exemplo n.º 6
0
 def test_meet_expectations_warrant_first(self):
     arbiter = Arbiter(None)
     arbiter.warrant(('check_name', ), 'right', 'w_basis')
     arbiter.predict(('check_name', ), 'right', 'p_basis')