Beispiel #1
0
def test_get_new_release_version_breaking(mocker):
    # Given
    file_mock = mocker.patch('os.path.isfile')
    file_mock.return_value = False

    # When
    result: str = create_release.get_new_release_version(
        '2', '1.2.3', '.', create_release.ReleaseType.BREAKING)

    # Then
    assert result == '2.0.0-1'
Beispiel #2
0
def test_get_new_release_version_feature(mocker):
    # Given
    file_mock = mocker.patch('os.path.isfile')
    file_mock.return_value = False

    # When
    result: str = create_release.get_new_release_version(
        '2', '1.2.3', '.', create_release.ReleaseType.FEATURE)

    # Then
    assert result == '1.3.0-1'
Beispiel #3
0
def test_get_new_release_version_file_new_release(mocker):
    # Given
    file_mock = mocker.patch('os.path.isfile')
    file_mock.return_value = True
    mocker.patch.object(builtins, 'open', mocker.mock_open(read_data='1.3.0'))

    # When
    result: str = create_release.get_new_release_version(
        '2', '1.2.3', '/some/path', create_release.ReleaseType.NONE)

    # Then
    assert result == '1.3.0-1'