Anonymous avatar Anonymous committed 7fb9ce6

Make tests in TestToxQuickstart more realistic by having them call tox._quickstart.process_input

Comments (0)

Files changed (2)

tests/test_quickstart.py

 class TestToxQuickstart(object):
     def test_pytest(self, tmpdir):
         d = {
-            'envlist': 'py24, py25, py26, py27, py32, py33, pypy',
+            'py24': True,
+            'py25': True,
+            'py26': True,
+            'py27': True,
+            'py32': True,
+            'py33': True,
+            'pypy': True,
             'commands': 'py.test',
             'deps': 'pytest',
         }
 
 [testenv]
 commands = py.test
-deps = pytest
+deps = 
+    pytest
 """.lstrip()
+        d = tox._quickstart.process_input(d)
         tox._quickstart.generate(d)
         result = open('tox.ini').read()
         # print(result)
 
     def test_setup_py_test(self, tmpdir):
         d = {
-            'envlist': 'py26, py27',
+            'py26': True,
+            'py27': True,
             'commands': 'python setup.py test',
             'deps': '',
         }
 [testenv]
 commands = python setup.py test
 deps = 
+    
 """.lstrip()
+        d = tox._quickstart.process_input(d)
         tox._quickstart.generate(d)
         result = open('tox.ini').read()
         # print(result)
 
     def test_trial(self, tmpdir):
         d = {
-            'envlist': 'py27',
+            'py27': True,
             'commands': 'trial',
             'deps': 'Twisted',
         }
 
 [testenv]
 commands = trial
-deps = Twisted
+deps = 
+    Twisted
 """.lstrip()
+        d = tox._quickstart.process_input(d)
         tox._quickstart.generate(d)
         result = open('tox.ini').read()
         # print(result)
 
     def test_nosetests(self, tmpdir):
         d = {
-            'envlist': 'py27, py32, py33, pypy',
+            'py27': True,
+            'py32': True,
+            'py33': True,
+            'pypy': True,
             'commands': 'nosetests -v',
             'deps': 'nose',
         }
 
 [testenv]
 commands = nosetests -v
-deps = nose
+deps = 
+    nose
 """.lstrip()
+        d = tox._quickstart.process_input(d)
         tox._quickstart.generate(d)
         result = open('tox.ini').read()
         # print(result)

tox/_quickstart.py

 
 
 def process_input(d):
-    d['envlist'] = ', '.join([env for env in all_envs if d[env] is True])
+    d['envlist'] = ', '.join([env for env in all_envs if d.get(env) is True])
     d['deps'] = '\n' + '\n'.join(['    %s' % dep.strip() for dep in d['deps'].split(',')])
 
     return d
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.