Detailed tests of choose.py =========================== .. :doctest: .. :setup: zest.releaser.tests.functional.setup .. :teardown: zest.releaser.tests.functional.teardown Some initial imports: >>> from zest.releaser import choose >>> import os >>> from zest.releaser import utils >>> utils.TESTMODE = True Choose makes the choice between version control systems. Subversion: >>> os.chdir(svnsourcedir) >>> choose.version_control() Mercurial: >>> os.chdir(hgsourcedir) >>> choose.version_control() Bazaar: >>> os.chdir(bzrsourcedir) >>> choose.version_control() Git: >>> os.chdir(gitsourcedir) >>> choose.version_control() It works when we are in a sub directory too: >>> os.chdir(gitsourcedir) >>> os.chdir('src') >>> utils.test_answer_book.set_answers(['n']) >>> choose.version_control() Question: You are NOT in the root of the repository. Do you want to go there? (Y/n)? Our reply: n >>> utils.test_answer_book.set_answers(['y']) >>> choose.version_control() Question: You are NOT in the root of the repository. Do you want to go there? (Y/n)? Our reply: y When no version control system is found, zest.releaser exits (with a log message, but we don't test those yet): >>> os.chdir(tempdir) >>> choose.version_control() Traceback (most recent call last): ... RuntimeError: SYSTEM EXIT (code=1)