def _test_clob(self, asfile=0):
        assert self.has_table("clobtable"), "no clob table"
        tabname, sql = self.table("clobtable")

        c = self.cursor()
        try:
            hello = "hello" * 1024 * 10

            c.execute(sql)
            self.db.commit()

            if asfile:
                fp = open(tempfile.mktemp(), "w")
                fp.write(hello)
                fp.flush()
                fp.close()
                obj = open(fp.name, "r")
            else:
                obj = hello

            c.execute("insert into %s (a, b) values (?, ?)" % (tabname), [(0, obj)], {1:zxJDBC.CLOB})
            c.execute("select * from %s" % (tabname), maxrows=1)
            f = c.fetchall()
            assert len(f) == 1, (1, len(f)) % "expected [%d], got [%d]"
            assert hello == f[0][1], "clobs are not equal"

        finally:
            c.execute("drop table %s" % (tabname))
            c.close()
            self.db.commit()
            if asfile:
                obj.close()
                os.remove(obj.name)
dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/test/zxjdbc/zxtest.py/LOBTestCase._test_clob/swapped operands of `%`