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

        actual = ftpscraper.buildExists(
              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_insertBuild(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:
            ftpscraper.insertBuild(me.cur, 'PRODUCTNAME5', 'VERSIONAME5',
                  'PLATFORMNAME5', '5', 'BUILDTYPE5', '5', 'REPO5')
            actual = ftpscraper.buildExists(me.cur, 'PRODUCTNAME5',
                  'VERSIONAME5', 'PLATFORMNAME5', '5', 'BUILDTYPE5',
                  '5', 'REPO5')
            assert actual == 1, "expected 1, got %s" % (actual)
        except Exception, x:
            print "Exception in do_insertBuild() ... Error: ", type(x), x
            socorro.lib.util.reportExceptionAndAbort(me.fileLogger)