def testProcessRetrievedInventory(): print(sys._getframe().f_code.co_name + ": ") dbConnect = DbConnect(InventoryDAO.getDbDir()) connector = dbConnect.getConnection() customerId = 1 barcode = 1 quantity = 2 androidService = AndroidService() inventoryReservation = androidService.reserveInventoryIfAvailable(customerId, barcode, quantity) print(inventoryReservation) # (True, reservedInventoryLoc, newVirtualCartRowId) arduinoService = ArduinoService() print( arduinoService.processRetrievedInventory(1, 1) ) inventoryDAO = InventoryDAO(connector) print( inventoryDAO.selectAllEntries() ) virtualCartDAO = VirtualCartDAO(connector) print( virtualCartDAO.selectAllEntries() ) print("===================================================") print("Testing testProcessRetrievedInventory-------------------complete\n\n\n")
def populateVirtualCart(): print(sys._getframe().f_code.co_name + ": ") dao = VirtualCartDAO(gc_connector) # dao.createAnEntry( (1, 1, 1, 0) ) # dao.createAnEntry( (1, 2, 2, 0) ) # dao.createAnEntry( (1, 3, 1, 0) ) # dao.createAnEntry( (2, 1, 1, 0) ) # dao.createAnEntry( (2, 2, 1, 0) ) # dao.createAnEntry( (2, 3, 1, 0) ) print(dao.selectAllEntries()) print("===================================================") print("Testing populateVirtualCart-------------------complete\n\n\n")