'Testing Envelope initilization.'

def test01_init(self):

    e1 = Envelope((0, 0, 5, 5))
    e2 = Envelope(0, 0, 5, 5)
    e3 = Envelope(0, '0', '5', 5)
    e4 = Envelope(e1._envelope)
    self.assertRaises(OGRException, Envelope, (5, 5, 0, 0))
    self.assertRaises(OGRException, Envelope, 5, 5, 0, 0)
    self.assertRaises(OGRException, Envelope, (0, 0, 5, 5, 3))
    self.assertRaises(OGRException, Envelope, ())
    self.assertRaises(ValueError, Envelope, 0, 'a', 5, 5)
    self.assertRaises(TypeError, Envelope, u'foo')
    self.assertRaises(OGRException, Envelope, (1, 1, 0, 0))
    try:
        Envelope(0, 0, 0, 0)
    except OGRException:
        self.fail("shouldn't    raise    an    exception    for    min_x    ==    max_x    or    min_y    ==    max_y")
