def test_calculation_end_month_arg_only_year(self):
        value = '2009'

        with pytest.raises(argparse.ArgumentTypeError) as e:
            _ = execution_utils.calculation_end_month_arg(value)

        assert "calculation_end_month parameter must be in the format YYYY-MM." in str(e.value)
    def test_calculation_end_month_arg_after_this_month(self):
        value = '2030-01'

        with pytest.raises(argparse.ArgumentTypeError) as e:
            _ = execution_utils.calculation_end_month_arg(value)

        assert "calculation_end_month parameter cannot be a month in the future." in str(e.value)
Exemplo n.º 3
0
    def test_calculation_end_month_arg(self):
        value = '2009-01'

        return_value = execution_utils.calculation_end_month_arg(value)

        self.assertEqual(return_value, value)