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')
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)
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)
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')
def test_meet_expectations_warrant_first(self): arbiter = Arbiter(None) arbiter.warrant(('check_name',), 'right', 'w_basis') arbiter.predict(('check_name',), 'right', 'p_basis')
def test_meet_expectations_warrant_first(self): arbiter = Arbiter(None) arbiter.warrant(('check_name', ), 'right', 'w_basis') arbiter.predict(('check_name', ), 'right', 'p_basis')