'test that bindnames() works correctly.'

def testBindNames(self):

    self.failUnlessRaises(cx_Oracle.ProgrammingError, self.cursor.bindnames)
    self.cursor.prepare(u'begin    null;    end;')
    self.failUnlessEqual(self.cursor.bindnames(), [])
    self.cursor.prepare(u'begin    :retval    :=    :inval    +    5;    end;')
    self.failUnlessEqual(self.cursor.bindnames(), ['RETVAL', 'INVAL'])
    self.cursor.prepare(u'begin    :retval    :=    :a    *    :a    +    :b    *    :b;    end;')
    self.failUnlessEqual(self.cursor.bindnames(), ['RETVAL', 'A', 'B'])
    self.cursor.prepare((u'begin    :a    :=    :b    +    :c    +    :d    +    :e    +    :f    +    :g    +    ' + ':h    +    :i    +    :j    +    :k    +    :l;    end;'))
    self.failUnlessEqual(self.cursor.bindnames(), [u'A', u'B', u'C', u'D', u'E', u'F', u'G', u'H', u'I', u'J', u'K', u'L'])
