'Testing relate() and relate_pattern().'

def test_relate_pattern(self):

    g = fromstr(u'POINT    (0    0)')
    self.assertRaises(GEOSException, g.relate_pattern, 0, u'invalid    pattern,    yo')
    for rg in self.geometries.relate_geoms:
        a = fromstr(rg.wkt_a)
        b = fromstr(rg.wkt_b)
        self.assertEqual(rg.result, a.relate_pattern(b, rg.pattern))
        self.assertEqual(rg.pattern, a.relate(b))
