def test_Utilities__test_2(): """If the above is not met, and there is an extra argument it returns it.""" assert test(False, 1, False, 2, 3) == 3 assert test(False, 1, 2) == 2 assert test(1) == 1 assert not test(False)
def test_test_single_value_true(): from RestrictedPython.Utilities import test assert test(True) is True
def test_test_odd_values_last_false(): from RestrictedPython.Utilities import test assert test(False, 'first', False, 'second', False) is False
def test_test_odd_values_last_true(): from RestrictedPython.Utilities import test assert test(False, 'first', False, 'second', 'third') == 'third'
def test_test_odd_values_not_first_true(): from RestrictedPython.Utilities import test assert test(False, 'first', True, 'second', False) == 'second'
def test_test_even_values_first_true(): from RestrictedPython.Utilities import test assert test(True, 'first', True, 'second') == 'first'
def test_test_single_value_False(): from RestrictedPython.Utilities import test assert test(False) is False
def test_test_odd_values_last_false(self): from RestrictedPython.Utilities import test self.assertEqual(test(False, 'first', False, 'second', False), False)
def test_test_odd_values_first_true(self): from RestrictedPython.Utilities import test self.assertEqual(test(True, 'first', True, 'second', False), 'first')
def test_test_even_values_not_first_true(self): from RestrictedPython.Utilities import test self.assertEqual(test(False, 'first', True, 'second'), 'second')
def test_test_single_value_False(self): from RestrictedPython.Utilities import test self.failIf(test(False))
def test_test_single_value_true(self): from RestrictedPython.Utilities import test self.failUnless(test(True))
def test(self, *args): return test(*args)
def test_Utilities__test_1(): """It returns the first arg after the first argument which is True""" assert test(True, 1, False, 2) == 1 assert test(False, 1, True, 2) == 2 assert test(False, 1, False, 2, True, 3) == 3
def test_Utilities__test_3(): """It returns None if there are only False args followed by something.""" assert test(False, 1) is None assert test(False, 1, False, 2) is None