Esempio n. 1
0
    def do_build_exists(self, d, correct):
        me.cur = me.conn.cursor(cursor_factory=psy.LoggingCursor)
        me.cur.setLogger(me.fileLogger)

        actual = buildutil.build_exists(
              me.cur, d[0], d[1], d[2], d[3], d[4], d[5], d[6])
        assert actual == correct, "expected %s, got %s " % (correct, actual)
Esempio n. 2
0
    def test_insert_build(self):
        me.cur = me.conn.cursor(cursor_factory=psy.LoggingCursor)
        me.cur.setLogger(me.fileLogger)

        sql = """DELETE FROM releases_raw
                 WHERE product_name = 'PRODUCTNAME5'"""
        me.cur.execute(sql)
        me.cur.connection.commit()

        try:
            buildutil.insert_build(me.cur, 'PRODUCTNAME5', 'VERSIONAME5',
                  'PLATFORMNAME5', '5', 'BUILDTYPE5', '5', 'REPO5')
            actual = buildutil.build_exists(me.cur, 'PRODUCTNAME5',
                  'VERSIONAME5', 'PLATFORMNAME5', '5', 'BUILDTYPE5',
                  '5', 'REPO5')
            assert actual == 1, "expected 1, got %s" % (actual)
        except Exception, x:
            print "Exception in do_insert_build() ... Error: ", type(x), x
            socorro.lib.util.reportExceptionAndAbort(me.fileLogger)