Esempio n. 1
0
 def testBasic (self):
     self.assertRaises(pyxb.BadTypeValueError, xsd.gDay, 0)
     self.assertRaises(pyxb.BadTypeValueError, xsd.gDay, 42)
     v = xsd.gDay('---27')
     self.assertEqual(v.day, 27)
     v = xsd.gDay(27)
     self.assertEqual(v.day, 27)
Esempio n. 2
0
 def testBasic(self):
     self.assertRaises(pyxb.BadTypeValueError, xsd.gDay, 0)
     self.assertRaises(pyxb.BadTypeValueError, xsd.gDay, 42)
     v = xsd.gDay('27')
     self.assertEqual(v.day, 27)
     v = xsd.gDay(27)
     self.assertEqual(v.day, 27)
Esempio n. 3
0
    def testTimezoned (self):
        dt = xsd.gDay('---31Z')
        self.assertEqual('1900-01-31T00:00:00+00:00', dt.isoformat())
        self.assertEqual('---31Z', dt.xsdLiteral())

        dt = xsd.gDay('---31-14:00')
        self.assertEqual('1900-01-31T00:00:00-14:00', dt.isoformat())
        self.assertEqual('---31-14:00', dt.xsdLiteral())

        dt = xsd.gDay('---31+14:00')
        self.assertEqual('1900-01-31T00:00:00+14:00', dt.isoformat())
        self.assertEqual('---31+14:00', dt.xsdLiteral())
Esempio n. 4
0
    def testTimezoned (self):
        dt = xsd.gDay('---31Z')
        self.assertEqual('1900-01-31T00:00:00+00:00', dt.isoformat())
        self.assertEqual('---31Z', dt.xsdLiteral())

        dt = xsd.gDay('---31-14:00')
        self.assertEqual('1900-01-31T00:00:00-14:00', dt.isoformat())
        self.assertEqual('---31-14:00', dt.xsdLiteral())

        dt = xsd.gDay('---31+14:00')
        self.assertEqual('1900-01-31T00:00:00+14:00', dt.isoformat())
        self.assertEqual('---31+14:00', dt.xsdLiteral())
Esempio n. 5
0
 def XtestAccessor (self):
     v = xsd.gDay(27)
     self.assertRaises((AttributeError, TypeError), getattr, v, 'year')
     self.assertRaises((AttributeError, TypeError), getattr, v, 'month')
     #self.assertRaises((AttributeError, TypeError), getattr, v, 'day')
     self.assertRaises((AttributeError, TypeError), setattr, v, 'year', 5)
     self.assertRaises((AttributeError, TypeError), setattr, v, 'month', 5)
     self.assertRaises((AttributeError, TypeError), setattr, v, 'day', 5)
Esempio n. 6
0
 def testAccessor(self):
     v = xsd.gDay(27)
     self.assertRaises((AttributeError, TypeError), getattr, v, 'year')
     self.assertRaises((AttributeError, TypeError), getattr, v, 'month')
     #self.assertRaises((AttributeError, TypeError), getattr, v, 'day')
     self.assertRaises((AttributeError, TypeError), setattr, v, 'year', 5)
     self.assertRaises((AttributeError, TypeError), setattr, v, 'month', 5)
     self.assertRaises((AttributeError, TypeError), setattr, v, 'day', 5)
Esempio n. 7
0
 def testXSDLiteral (self):
     v = xsd.gDay(27)
     self.assertEqual('---27', v.xsdLiteral())
Esempio n. 8
0
 def testXSDLiteral(self):
     v = xsd.gDay(27)
     self.assertEqual('27', v.xsdLiteral())