Ejemplo n.º 1
0
 def test_pythonvalue(self):
     instance = builtins.gDay()
     assert instance.pythonvalue('---01') == (1, None)
     assert instance.pythonvalue('---01Z') == (1, pytz.utc)
     assert instance.pythonvalue('---01+02:00') == (1, pytz.FixedOffset(120))
     assert instance.pythonvalue('---01-04:00') == (1, pytz.FixedOffset(-240))
     assert instance.pythonvalue('---15') == (15, None)
     assert instance.pythonvalue('---31') == (31, None)
     with pytest.raises(builtins.ParseError):
         assert instance.pythonvalue('99')
Ejemplo n.º 2
0
    def test_xmlvalue(self):
        instance = builtins.gDay()

        value = (1, None)
        assert instance.xmlvalue(value) == '---01'

        value = (1, pytz.FixedOffset(120))
        assert instance.xmlvalue(value) == '---01+02:00'

        value = (1, pytz.FixedOffset(-240))
        assert instance.xmlvalue(value) == '---01-04:00'
Ejemplo n.º 3
0
    def test_xmlvalue(self):
        instance = builtins.gDay()

        value = (1, None)
        assert instance.xmlvalue(value) == '---01'

        value = (1, pytz.FixedOffset(120))
        assert instance.xmlvalue(value) == '---01+02:00'

        value = (1, pytz.FixedOffset(-240))
        assert instance.xmlvalue(value) == '---01-04:00'
Ejemplo n.º 4
0
 def test_pythonvalue(self):
     instance = builtins.gDay()
     assert instance.pythonvalue('---01') == (1, None)
     assert instance.pythonvalue('---01Z') == (1, pytz.utc)
     assert instance.pythonvalue('---01+02:00') == (1,
                                                    pytz.FixedOffset(120))
     assert instance.pythonvalue('---01-04:00') == (1,
                                                    pytz.FixedOffset(-240))
     assert instance.pythonvalue('---15') == (15, None)
     assert instance.pythonvalue('---31') == (31, None)
     with pytest.raises(builtins.ParseError):
         assert instance.pythonvalue('99')