Пример #1
0
    def test_pythonvalue(self):
        instance = builtins.gYear()
        assert instance.pythonvalue('2001') == (2001, None)
        assert instance.pythonvalue('2001+02:00') == (2001, pytz.FixedOffset(120))
        assert instance.pythonvalue('2001Z') == (2001, pytz.utc)
        assert instance.pythonvalue('2001+00:00') == (2001, pytz.utc)
        assert instance.pythonvalue('-2001') == (-2001, None)
        assert instance.pythonvalue('-20000') == (-20000, None)

        with pytest.raises(builtins.ParseError):
            assert instance.pythonvalue('99')
Пример #2
0
    def test_pythonvalue(self):
        instance = builtins.gYear()
        assert instance.pythonvalue('2001') == (2001, None)
        assert instance.pythonvalue('2001+02:00') == (2001,
                                                      pytz.FixedOffset(120))
        assert instance.pythonvalue('2001Z') == (2001, pytz.utc)
        assert instance.pythonvalue('2001+00:00') == (2001, pytz.utc)
        assert instance.pythonvalue('-2001') == (-2001, None)
        assert instance.pythonvalue('-20000') == (-20000, None)

        with pytest.raises(builtins.ParseError):
            assert instance.pythonvalue('99')
Пример #3
0
 def test_xmlvalue(self):
     instance = builtins.gYear()
     instance.xmlvalue((2001, None)) == '2001'
     instance.xmlvalue((2001, pytz.utc)) == '2001Z'
Пример #4
0
 def test_xmlvalue(self):
     instance = builtins.gYear()
     instance.xmlvalue((2001, None)) == '2001'
     instance.xmlvalue((2001, pytz.utc)) == '2001Z'