diff options
| author | Marc Abramowitz <marc@marc-abramowitz.com> | 2012-11-24 08:22:18 -0800 |
|---|---|---|
| committer | Marc Abramowitz <marc@marc-abramowitz.com> | 2012-11-24 08:22:18 -0800 |
| commit | 3e20ed7a4fa80f685c515bcda66eac1b647f02ca (patch) | |
| tree | 67662a0aa8e2b64f09368329b60276032b0bb9ec /tests/test_quickstart.py | |
| parent | e54f50beb67fdf787556d5a3a5905e6ed1686704 (diff) | |
| download | tox-3e20ed7a4fa80f685c515bcda66eac1b647f02ca.tar.gz | |
tox-quickstart: Prompt before overwriting an existing tox.ini file.
Diffstat (limited to 'tests/test_quickstart.py')
| -rw-r--r-- | tests/test_quickstart.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/test_quickstart.py b/tests/test_quickstart.py index 446954e..145bb98 100644 --- a/tests/test_quickstart.py +++ b/tests/test_quickstart.py @@ -209,6 +209,36 @@ deps = result = open('tox.ini').read() assert(result == expected_tox_ini) + def test_quickstart_main_existing_tox_ini(self, monkeypatch, tmpdir): + try: + f = open('tox.ini', 'w') + f.write('foo bar\n') + finally: + f.close() + + monkeypatch.setattr( + tox._quickstart, 'term_input', + self.get_mock_term_input(['4', '', '', '', '', '', '', '', '', '', '', '', '', ''])) + + tox._quickstart.main(argv=['tox-quickstart']) + + expected_tox_ini = """ +# Tox (http://tox.testrun.org/) is a tool for running tests +# in multiple virtualenvs. This configuration file will run the +# test suite on all supported python versions. To use it, "pip install tox" +# and then run "tox" from this directory. + +[tox] +envlist = py24, py25, py26, py27, py30, py31, py32, py33, pypy, jython + +[testenv] +commands = {envpython} setup.py test +deps = + +""".lstrip() + result = open('tox-generated.ini').read() + assert(result == expected_tox_ini) + class TestToxQuickstart(object): def test_pytest(self, tmpdir): |
