예제 #1
0
 def test_interpret_callback_response_only_data(self):
     """Test that a callback result is transformed into the right format."""
     r = utils.interpret_callback_result(5)
     assert r == (True, 5)
예제 #2
0
 def test_interpret_callback_response_none(self):
     """Test that a callback result is transformed into the right format."""
     r = utils.interpret_callback_result(None)
     assert r == (False, None)
예제 #3
0
 def test_interpret_callback_result_dual_tuple_data_first(self):
     """Test that a callback result is transformed into the right format."""
     r_true = utils.interpret_callback_result((128, 67))
     assert r_true == (True, 67)
예제 #4
0
 def test_interpret_callback_result_3_tuple(self):
     """Test that a callback result is transformed into the right format."""
     r_true = utils.interpret_callback_result((True, 67, 8))
     r_false = utils.interpret_callback_result((False, {'e': 'fail'}, False))
     assert r_true == (True, 67)
     assert r_false == (False, {'e': 'fail'})
예제 #5
0
 def test_interpret_callback_result_boolean(self):
     """Test that a callback result is transformed into the right format."""
     r_true = utils.interpret_callback_result(True)
     r_false = utils.interpret_callback_result(False)
     assert r_true == (True, None)
     assert r_false == (False, None)