def test_pythonvalue(self):
        instance = builtins.gMonthDay()
        assert instance.pythonvalue('--05-01') == (5, 1, None)
        assert instance.pythonvalue('--11-01Z') == (11, 1, pytz.utc)
        assert instance.pythonvalue('--11-01+02:00') == (11, 1, pytz.FixedOffset(120))
        assert instance.pythonvalue('--11-01-04:00') == (11, 1, pytz.FixedOffset(-240))
        assert instance.pythonvalue('--11-15') == (11, 15, None)
        assert instance.pythonvalue('--02-29') == (2, 29, None)

        with pytest.raises(builtins.ParseError):
            assert instance.pythonvalue('99')
Exemple #2
0
    def test_pythonvalue(self):
        instance = builtins.gMonthDay()
        assert instance.pythonvalue("--05-01") == (5, 1, None)
        assert instance.pythonvalue("--11-01Z") == (11, 1, pytz.utc)
        assert instance.pythonvalue("--11-01+02:00") == (11, 1, pytz.FixedOffset(120))
        assert instance.pythonvalue("--11-01-04:00") == (11, 1, pytz.FixedOffset(-240))
        assert instance.pythonvalue("--11-15") == (11, 15, None)
        assert instance.pythonvalue("--02-29") == (2, 29, None)
        assert instance.pythonvalue("\t\r\n --05-01 ") == (5, 1, None)

        with pytest.raises(builtins.ParseError):
            assert instance.pythonvalue("99")
Exemple #3
0
 def test_xmlvalue(self):
     instance = builtins.gMonthDay()
     assert instance.xmlvalue((12, 30, None)) == "--12-30"
 def test_xmlvalue(self):
     instance = builtins.gMonthDay()
     assert instance.xmlvalue((12, 30, None)) == '--12-30'