Ejemplo n.º 1
0
    def test_conflicting_options_should_get_prefixed(self):
        from behave_django.management.commands.behave import Command
        command = Command()
        args = command.get_behave_args(
            argv=['manage.py', 'behave', '--behave-k', '--behave-version'])

        assert args == ['-k', '--version']
Ejemplo n.º 2
0
    def test_conflicting_options_should_get_prefixed(self):
        from behave_django.management.commands.behave import Command
        command = Command()
        args = command.get_behave_args(
            argv=['manage.py', 'behave', '--behave-k', '--behave-version'])

        assert args == ['-k', '--version']
Ejemplo n.º 3
0
    def test_no_arguments_should_not_cause_issues(self):
        from behave_django.management.commands.behave import Command
        command = Command()
        args = command.get_behave_args(
            argv=['manage.py', 'behave'])

        assert args == []
Ejemplo n.º 4
0
    def test_no_arguments_should_not_cause_issues(self):
        from behave_django.management.commands.behave import Command
        command = Command()
        args = command.get_behave_args(
            argv=['manage.py', 'behave'])

        assert args == []
Ejemplo n.º 5
0
    def test_should_return_positional_args(self):
        from behave_django.management.commands.behave import Command
        command = Command()
        args = command.get_behave_args(argv=[
            'manage.py', 'behave', '--format', 'progress', '--settings',
            'test_project.settings', 'features/running-tests.feature'
        ])

        assert 'features/running-tests.feature' in args
Ejemplo n.º 6
0
    def test_should_return_positional_args(self):
        from behave_django.management.commands.behave import Command
        command = Command()
        args = command.get_behave_args(
            argv=['manage.py', 'behave',
                  '--format', 'progress',
                  '--settings', 'test_project.settings',
                  'features/running-tests.feature'])

        assert 'features/running-tests.feature' in args
Ejemplo n.º 7
0
    def test_should_not_include_non_behave_arguments(self):
        from behave_django.management.commands.behave import Command
        command = Command()
        args = command.get_behave_args(argv=[
            'manage.py', 'behave', '--format', 'progress', '--settings',
            'test_project.settings', 'features/running-tests.feature'
        ])

        assert '--settings' not in args
        assert 'test_project.settings' not in args
Ejemplo n.º 8
0
    def test_should_not_include_non_behave_arguments(self):
        from behave_django.management.commands.behave import Command
        command = Command()
        args = command.get_behave_args(
            argv=['manage.py', 'behave',
                  '--format', 'progress',
                  '--settings', 'test_project.settings',
                  'features/running-tests.feature'])

        assert '--settings' not in args
        assert 'test_project.settings' not in args
Ejemplo n.º 9
0
    def test_should_accept_behave_arguments(self):
        from behave_django.management.commands.behave import Command
        command = Command()
        args = command.get_behave_args(argv=[
            'manage.py', 'behave', '--format', 'progress', '--settings',
            'test_project.settings', '-i', 'some-pattern',
            'features/running-tests.feature'
        ])

        assert '--format' in args
        assert 'progress' in args
        assert '-i' in args
        assert 'some-pattern' in args
Ejemplo n.º 10
0
    def test_should_accept_behave_arguments(self):
        from behave_django.management.commands.behave import Command
        command = Command()
        args = command.get_behave_args(
            argv=['manage.py', 'behave',
                  '--format', 'progress',
                  '--settings', 'test_project.settings',
                  '-i', 'some-pattern',
                  'features/running-tests.feature'])

        assert '--format' in args
        assert 'progress' in args
        assert '-i' in args
        assert 'some-pattern' in args