Exemplo n.º 1
0
def test_strftime_zero_padded_short_day_is_padded(mock_strftime):
    mock_strftime.return_value = '04'
    assert vpart.strftime('0D') == '04'
Exemplo n.º 2
0
def test_strftime_short_day_is_not_padded(mock_strftime):
    mock_strftime.return_value = '04'
    assert vpart.strftime('DD') == '4'
Exemplo n.º 3
0
def test_strftime_zero_padded_short_day(mock_strftime):
    vpart.strftime('0D')
    mock_strftime.assert_called_with('%d')
Exemplo n.º 4
0
def test_strftime_zero_padded_short_month(mock_strftime):
    vpart.strftime('0M')
    mock_strftime.assert_called_with('%m')
Exemplo n.º 5
0
def test_strftime_short_day(mock_strftime):
    vpart.strftime('DD')
    mock_strftime.assert_called_with('%d')
Exemplo n.º 6
0
def test_strftime_short_year_is_not_padded(mock_strftime):
    mock_strftime.return_value = '03'
    assert vpart.strftime('YY') == '3'
Exemplo n.º 7
0
def test_strftime_short_month(mock_strftime):
    vpart.strftime('MM')
    mock_strftime.assert_called_with('%m')
Exemplo n.º 8
0
def test_strftime_full_year(mock_strftime):
    vpart.strftime('YYYY')
    mock_strftime.assert_called_with('%Y')
Exemplo n.º 9
0
def test_strftime_short_year(mock_strftime):
    vpart.strftime('YY')
    mock_strftime.assert_called_with('%y')
Exemplo n.º 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')
Exemplo n.º 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'
Exemplo n.º 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'
Exemplo n.º 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')
Exemplo n.º 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'
Exemplo n.º 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')
Exemplo n.º 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'