Пример #1
0
def test_mutually_exclusive():
    option1 = 'yes'
    option2 = None

    mutually_exclusive(options=['--option1', '--option2'], scope=locals())

    option2 = 'no'
    with pytest.raises(UsageError):
        mutually_exclusive(options=['--option1', '--option2'], scope=locals())
Пример #2
0
def test_mutually_exclusive():
    option1 = 'yes'
    option2 = None

    mutually_exclusive(
        options=[
            '--option1',
            '--option2'],
        scope=locals())

    option2 = 'no'
    with pytest.raises(UsageError):
        mutually_exclusive(
            options=[
                '--option1',
                '--option2'],
            scope=locals())