Example #1
0
def test_unknown_provider():
    """Make sure that we get the appropriate error if a ReleaseProvider cannot be found
    """

    comp = build_path('unknown_provider_comp')

    with pytest.raises(DataError):
        release(comp)
Example #2
0
def test_nosteps_comp():
    """Make sure that if there are no release steps we throw an error
    """

    comp = build_path('nosteps_comp')

    with pytest.raises(ArgumentError):
        release(comp)
Example #3
0
def test_unbuilt_devmode_comp():
    """Make sure that we throw an error if we try to release an unbuilt dev mode component
    """

    comp = build_path('unbuilt_dev_mode_comp')

    with pytest.raises(ArgumentError):
        release(comp)
Example #4
0
def test_failed_release2():
    """Make sure appropriate dirty error is thrown if releasing fails and cannot roll back
    """

    comp = build_path('fail_second_release_comp')

    with pytest.raises(DirtyReleaseFailureError):
        try:
            release(comp)
        except DirtyReleaseFailureError as exc:
            assert exc.params['failed_step'] == 1
            assert exc.params['failed_unrelease'] == 0
            assert exc.params['operation'] == 'release'

            raise
Example #5
0
def test_failed_release1():
    """Make sure appropriate error is thrown when release fails

    Also test to make sure unrelease happens correctly
    """

    comp = build_path('fail_first_release_comp')

    with pytest.raises(CleanReleaseFailureError):
        try:
            release(comp)
        except CleanReleaseFailureError as exc:
            assert exc.params['failed_step'] == 0
            assert exc.params['operation'] == 'release'
            raise
Example #6
0
def test_built_devmode_comp():
    """Make sure that if a devmode comp has been built we release the build/output folder
    """

    comp = build_path('dev_mode_comp')
    release(comp)
Example #7
0
def test_successful_release():
    comp = build_path('successful_release_comp')

    release(comp)