def __init__(self, connection):
     BaseDAO.__init__(
         self, connection, FootwearDesignDetails.getTableName(), FootwearDesignDetails.getColumnHeaders()
     )
Beispiel #2
0
from Service.DbConnect import DbConnect

from DAO.BaseDAO import BaseDAO
from Tables.TableStructs import FootwearDesignDetails


g_tableName = FootwearDesignDetails.getTableName()
g_columnHeaders = FootwearDesignDetails.getColumnHeaders()


def testCreateAnEntry(baseDAO):

    print("Testing createAnEntry: ")

    productName = "Shoe"
    brandName = "Brand"
    description = "Description"
    cost = 1.00

    for i in range(1, 10 + 1):
        entry = (productName + str(i), brandName + str(i), description + str(i), cost)
        baseDAO.createAnEntry(entry)
        print("created: " + str(entry))

        cost += 1

    allEntries = baseDAO.selectAllEntries()
    print(allEntries)

    print("===================================================")
    print("Testing createAnEntry----------------------complete\n\n\n")