Beispiel #1
0
    def test_script_with_multiple_commands(self):
        input = StringIO("""
language: python

python:
  - 2.5
  - 2.6
  - 2.7
  - 3.2
  - pypy

script:
  - python setup.py build
  - python setup.py install
  - python setup.py nosetests
        """)

        expected_output = """
# 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 = py25, py26, py27, py32, pypy

[testenv]
commands = 
    python setup.py build
    python setup.py install
    python setup.py nosetests
"""

        self.assertEqual(
            travis2tox(input).getvalue().strip(), expected_output.strip())
Beispiel #2
0
    def test_script_with_multiple_commands(self):
        input = StringIO("""
language: python

python:
  - 2.5
  - 2.6
  - 2.7
  - 3.2
  - pypy

script:
  - python setup.py build
  - python setup.py install
  - python setup.py nosetests
        """)

        expected_output = """
# 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 = py25, py26, py27, py32, pypy

[testenv]
commands = 
    python setup.py build
    python setup.py install
    python setup.py nosetests
"""

        self.assertEqual(travis2tox(input).getvalue().strip(), expected_output.strip())
Beispiel #3
0
def main():
    """The ``main`` for the ``travis2tox`` program."""

    parser = argparse.ArgumentParser(
        description='Convert a .travis.yml file to a tox.ini file.')
    parser.add_argument(
        'dot_travis_dot_yml_file',
        help='path to a .travis.yml file')
    args = parser.parse_args()

    tox_config = travis2tox(args.dot_travis_dot_yml_file)
    print(tox_config.getvalue())