Пример #1
0
def new_release(new_milestone):
    release_time = '2016-01-01'
    release = productreleases.create_release(
        version="1.DR1",
        release_date=release_time,
        download_url="pnc-cli-test-url",
        product_version_id=new_milestone.product_version_id,
        product_milestone_id=new_milestone.id,
        support_level='EOL')
    return release
Пример #2
0
def new_release(new_milestone):
    release_time = utils.unix_time_millis(datetime.datetime(2016, 1, 2, 12, 0, 0))
    release = productreleases.create_release(
        version="1.DR1",
        release_date=release_time,
        download_url="pnc-cli-test-url",
        product_version_id=new_milestone.product_version_id,
        product_milestone_id=new_milestone.id,
        support_level='EOL'
    )
    return release
Пример #3
0
def new_release(new_milestone):
    release_time = '2016-01-01'
    release = productreleases.create_release(
        version="1.DR1",
        release_date=release_time,
        download_url="pnc-cli-test-url",
        product_version_id=new_milestone.product_version_id,
        product_milestone_id=new_milestone.id,
        support_level='EOL'
    )
    return release
Пример #4
0
def test_create_release(mock_get_specific, mock_create_new, mock_create_object):
    result = productreleases.create_release(version='0.DR1',
                                            release_date='2016-01-01',
                                            download_url='https://tom.com',
                                            product_version_id=1,
                                            product_milestone_id=1,
                                            support_level='EOL')
    mock_get_specific.assert_called_once_with(id=1)
    mock_create_new.assert_called_once_with(body='created release')
    mock_create_object.assert_called_once_with(version='1.0.0.DR1',
                                               release_date='2016-01-01',
                                               download_url='https://tom.com',
                                               product_version_id=1,
                                               product_milestone_id=1,
                                               support_level='EOL')
    assert result == 'created release'
Пример #5
0
def test_create_release(mock_get_milestone_version, mock_get_specific, mock_create_new, mock_create_object):
    result = productreleases.create_release(version='0.DR1',
                                            release_date='2016-01-01',
                                            download_url='https://tom.com',
                                            product_version_id=1,
                                            product_milestone_id=1,
                                            support_level='EOL')
    mock_get_milestone_version.assert_called_once_with(1)
    mock_get_specific.assert_called_once_with(id='1')
    mock_create_new.assert_called_once_with(body='created release')
    mock_create_object.assert_called_once_with(version='1.0.0.DR1',
                                               release_date='2016-01-01',
                                               download_url='https://tom.com',
                                               product_version_id=1,
                                               product_milestone_id=1,
                                               support_level='EOL')
    assert result == 'created release'
Пример #6
0
def test_create_release_badversion(mock_get_specific, mock_create_new, mock_create_object):
    result = productreleases.create_release(version='x.x')
    assert not mock_create_object.called
    assert not mock_create_new.called
    assert not mock_get_specific.called
    assert not result