Пример #1
0
def test_model_should_create_new_objects():
    FriggSettings({'tasks': {'tests': ['tox']}})
    assert FriggSettings({
        'tasks': {
            'setup': ['tox']
        }
    }).tasks['tests'] != ['tox']
Пример #2
0
def test_update_should_keep_defaults_of_untouched_fields():
    settings = FriggSettings()
    settings.update({'tasks': {'tests': ['tox']}})
    assert settings.tasks['tests'] == ['tox']
    assert settings.tasks['setup'] == []
    assert settings.tasks['verbose'] == []
    assert settings.tasks['after_success'] == []
    assert settings.tasks['after_failure'] == []
Пример #3
0
def test_update_should_keep_defaults_of_untouched_fields():
    settings = FriggSettings()
    settings.update({'tasks': {'tests': ['tox']}})
    assert settings.tasks['tests'] == ['tox']
    assert settings.tasks['setup'] == []
    assert settings.tasks['verbose'] == []
    assert settings.tasks['after_success'] == []
    assert settings.tasks['after_failure'] == []
Пример #4
0
def test_has_after_tasks_should_return_correct_value_for_unsuccessful_builds():
    assert FriggSettings({
        'tasks': {
            'after_failure': ['tox']
        }
    }).has_after_tasks(False)
    assert not FriggSettings({
        'tasks': {
            'after_failure': []
        }
    }).has_after_tasks(False)
Пример #5
0
def test_update_should_update_dict():
    settings = FriggSettings()
    settings.update({'tasks': {'tests': ['tox']}})
    assert settings.tasks['tests'] == ['tox']
Пример #6
0
def test_model_without_tasks():
    assert 'setup' in FriggSettings({}).tasks
Пример #7
0
def test_settings_should_have_defaults():
    settings = FriggSettings()
    assert settings.tasks is not None
    assert settings.services is not None
    assert settings.preview is not None
Пример #8
0
def test_has_test_tasks_should_return_correct_value():
    assert FriggSettings({'tasks': {'tests': ['tox']}}).has_tests_tasks
    assert not FriggSettings({'tasks': {'tests': []}}).has_tests_tasks
Пример #9
0
def test_update_should_update_dict():
    settings = FriggSettings()
    settings.update({'tasks': {'tests': ['tox']}})
    assert settings.tasks['tests'] == ['tox']