Exemplo n.º 1
0
    def test_pythonvalue(self):
        instance = builtins.gMonth()
        assert instance.pythonvalue('--05') == (5, None)
        assert instance.pythonvalue('--11Z') == (11, pytz.utc)
        assert instance.pythonvalue('--11+02:00') == (11, pytz.FixedOffset(120))
        assert instance.pythonvalue('--11-04:00') == (11, pytz.FixedOffset(-240))
        assert instance.pythonvalue('--11') == (11, None)
        assert instance.pythonvalue('--02') == (2, None)

        with pytest.raises(builtins.ParseError):
            assert instance.pythonvalue('99')
Exemplo n.º 2
0
    def test_pythonvalue(self):
        instance = builtins.gMonth()
        assert instance.pythonvalue('--05') == (5, None)
        assert instance.pythonvalue('--11Z') == (11, pytz.utc)
        assert instance.pythonvalue('--11+02:00') == (11,
                                                      pytz.FixedOffset(120))
        assert instance.pythonvalue('--11-04:00') == (11,
                                                      pytz.FixedOffset(-240))
        assert instance.pythonvalue('--11') == (11, None)
        assert instance.pythonvalue('--02') == (2, None)

        with pytest.raises(builtins.ParseError):
            assert instance.pythonvalue('99')
Exemplo n.º 3
0
 def test_xmlvalue(self):
     instance = builtins.gMonth()
     assert instance.xmlvalue((12, None)) == '--12'
Exemplo n.º 4
0
 def test_xmlvalue(self):
     instance = builtins.gMonth()
     assert instance.xmlvalue((12, None)) == '--12'