Example #1
0
def test_strftime_zero_padded_short_day_is_padded(mock_strftime):
    mock_strftime.return_value = '04'
    assert vpart.strftime('0D') == '04'
Example #2
0
def test_strftime_short_day_is_not_padded(mock_strftime):
    mock_strftime.return_value = '04'
    assert vpart.strftime('DD') == '4'
Example #3
0
def test_strftime_zero_padded_short_day(mock_strftime):
    vpart.strftime('0D')
    mock_strftime.assert_called_with('%d')
Example #4
0
def test_strftime_zero_padded_short_month(mock_strftime):
    vpart.strftime('0M')
    mock_strftime.assert_called_with('%m')
Example #5
0
def test_strftime_short_day(mock_strftime):
    vpart.strftime('DD')
    mock_strftime.assert_called_with('%d')
Example #6
0
def test_strftime_short_year_is_not_padded(mock_strftime):
    mock_strftime.return_value = '03'
    assert vpart.strftime('YY') == '3'
Example #7
0
def test_strftime_short_month(mock_strftime):
    vpart.strftime('MM')
    mock_strftime.assert_called_with('%m')
Example #8
0
def test_strftime_full_year(mock_strftime):
    vpart.strftime('YYYY')
    mock_strftime.assert_called_with('%Y')
Example #9
0
def test_strftime_short_year(mock_strftime):
    vpart.strftime('YY')
    mock_strftime.assert_called_with('%y')
Example #10
0
def test_strftime_zero_padded_short_day(mocker):
    mock_strftime = mocker.patch('punch.version_part._strftime')
    vpart.strftime('0D')
    mock_strftime.assert_called_with('%d')
Example #11
0
def test_strftime_zero_padded_short_day_is_padded(mocker):
    mock_strftime = mocker.patch('punch.version_part._strftime')
    mock_strftime.return_value = '04'
    assert vpart.strftime('0D') == '04'
Example #12
0
def test_strftime_short_month_is_not_padded(mocker):
    mock_strftime = mocker.patch('punch.version_part._strftime')
    mock_strftime.return_value = '04'
    assert vpart.strftime('MM') == '4'
Example #13
0
def test_strftime_short_month(mocker):
    mock_strftime = mocker.patch('punch.version_part._strftime')
    vpart.strftime('MM')
    mock_strftime.assert_called_with('%m')
Example #14
0
def test_strftime_short_year_is_not_padded(mocker):
    mock_strftime = mocker.patch('punch.version_part._strftime')
    mock_strftime.return_value = '03'
    assert vpart.strftime('YY') == '3'
Example #15
0
def test_strftime_short_year(mocker):
    mock_strftime = mocker.patch('punch.version_part._strftime')
    vpart.strftime('YY')
    mock_strftime.assert_called_with('%y')
Example #16
0
def test_strftime_day_is_not_stripped_on_the_right(mocker):
    mock_strftime = mocker.patch('punch.version_part._strftime')
    mock_strftime.return_value = '10'
    assert vpart.strftime('DD') == '10'