#!/usr/bin/python2.4 import sys def test1(updateto, clean): callupdateto=[sys.argv[0], 'local', '--updateto', updateto] calllocal=[sys.argv[0], 'local'] if not clean: callupdateto.append('--no-clean') calllocal.append('--no-clean') if updateto: return (sys.argv[0], callupdateto) else: return (sys.argv[0], calllocal) def test2(updateto, clean): calllocal = [sys.argv[0], 'local'] if updateto: calllocal += ['--updateto', updateto] if not clean: calllocal.append('--no-clean') return (sys.argv[0], calllocal) if __name__ == '__main__': for updateto in (None, '2.3-1'): for clean in (True,False,None): t1 = test1(updateto=updateto, clean=clean) t2 = test2(updateto=updateto, clean=clean) print 'updateto=%s\tclean=%s\t%s\t%s' % (updateto, clean, t1 == t2, t1)