예제 #1
0
파일: test_audit.py 프로젝트: 64studio/pdk
 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')
예제 #2
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)
예제 #3
0
파일: test_audit.py 프로젝트: 64studio/pdk
 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)
예제 #4
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')
예제 #5
0
파일: test_audit.py 프로젝트: 64studio/pdk
 def test_meet_expectations_warrant_first(self):
     arbiter = Arbiter(None)
     arbiter.warrant(('check_name',), 'right', 'w_basis')
     arbiter.predict(('check_name',), 'right', 'p_basis')
예제 #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')