def test_strftime_zero_padded_short_day_is_padded(mock_strftime): mock_strftime.return_value = '04' assert vpart.strftime('0D') == '04'
def test_strftime_short_day_is_not_padded(mock_strftime): mock_strftime.return_value = '04' assert vpart.strftime('DD') == '4'
def test_strftime_zero_padded_short_day(mock_strftime): vpart.strftime('0D') mock_strftime.assert_called_with('%d')
def test_strftime_zero_padded_short_month(mock_strftime): vpart.strftime('0M') mock_strftime.assert_called_with('%m')
def test_strftime_short_day(mock_strftime): vpart.strftime('DD') mock_strftime.assert_called_with('%d')
def test_strftime_short_year_is_not_padded(mock_strftime): mock_strftime.return_value = '03' assert vpart.strftime('YY') == '3'
def test_strftime_short_month(mock_strftime): vpart.strftime('MM') mock_strftime.assert_called_with('%m')
def test_strftime_full_year(mock_strftime): vpart.strftime('YYYY') mock_strftime.assert_called_with('%Y')
def test_strftime_short_year(mock_strftime): vpart.strftime('YY') mock_strftime.assert_called_with('%y')
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')
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'
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'
def test_strftime_short_month(mocker): mock_strftime = mocker.patch('punch.version_part._strftime') vpart.strftime('MM') mock_strftime.assert_called_with('%m')
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'
def test_strftime_short_year(mocker): mock_strftime = mocker.patch('punch.version_part._strftime') vpart.strftime('YY') mock_strftime.assert_called_with('%y')
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'