示例#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']
示例#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']
示例#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 == []
示例#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 == []
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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