def getRoomsByExample(): Test.dalManager.connect() # By ID room = RoomBase.getRooms( roomID = 176 ) assert( room.name == '4-1-021' ) # By other attributes roomEx = Factory.newRoom() roomEx.site = 'prevessin' roomEx.comments = 'res' rooms = RoomBase.getRooms( roomExample = roomEx ) assert( len( rooms ) == 8 ) # 20 roomEx = Factory.newRoom() roomEx.capacity = 20 rooms = RoomBase.getRooms( roomExample = roomEx ) assert( len( rooms ) == 26 ) roomEx = Factory.newRoom() roomEx.isReservable = True roomEx.setEquipment( [ 'Video projector', 'Wireless' ] ) rooms = RoomBase.getRooms( roomExample = roomEx ) assert( len( rooms ) == 33 ) Test.dalManager.disconnect()
def getRoomsByExample(): Test.dalManager.connect() # By ID room = RoomBase.getRooms( roomID = 176 ) assert( room.name == '4-1-021' ) # By other attributes roomEx = Factory.newRoom() roomEx.site = 'prevessin' roomEx.comments = 'res' rooms = RoomBase.getRooms( roomExample = roomEx ) assert( len( rooms ) == 8 ) # 20 roomEx = Factory.newRoom() roomEx.capacity = 20 rooms = RoomBase.getRooms( roomExample = roomEx ) assert( len( rooms ) == 26 ) roomEx = Factory.newRoom() roomEx.isReservable = True roomEx.setEquipment( [ 'Video projector', 'Wireless' ] ) rooms = RoomBase.getRooms( roomExample = roomEx ) assert( len( rooms ) == 33 ) Test.dalManager.disconnect()
def getRoomsByExample(): Test.dalManager.connect() # By ID room = RoomBase.getRooms(roomID=176) assert room.name == "4-1-021" # By other attributes roomEx = Factory.newRoom() roomEx.site = "prevessin" roomEx.comments = "res" rooms = RoomBase.getRooms(roomExample=roomEx) assert len(rooms) == 8 # 20 roomEx = Factory.newRoom() roomEx.capacity = 20 rooms = RoomBase.getRooms(roomExample=roomEx) assert len(rooms) == 26 roomEx = Factory.newRoom() roomEx.isReservable = True roomEx.setEquipment(["Video projector", "Wireless"]) rooms = RoomBase.getRooms(roomExample=roomEx) assert len(rooms) == 33 Test.dalManager.disconnect()
def getNumberOfReservableRooms( *args, **kwargs ): """ Documentation in base class. """ location = kwargs.get( 'location', Location.getDefaultLocation().friendlyName ) room = Factory.newRoom() room.isReservable = True room.isActive = True return Room.countRooms( roomExample = room, location = location )
def getNumberOfReservableRooms( *args, **kwargs ): """ Documentation in base class. """ location = kwargs.get( 'location', Location.getDefaultLocation().friendlyName ) room = Factory.newRoom() room.isReservable = True room.isActive = True return Room.countRooms( roomExample = room, location = location )
def getRoomsByExampleDemo(): Test.dalManager.connect() roomEx = Factory.newRoom() roomEx.building = 513 roomEx.capacity = 20 rooms = CrossLocationQueries.getRooms( roomExample = roomEx ) for room in rooms: print "=============================" print room Test.dalManager.disconnect()
def getRoomsByExampleDemo(): Test.dalManager.connect() roomEx = Factory.newRoom() roomEx.building = 513 roomEx.capacity = 20 rooms = CrossLocationQueries.getRooms( roomExample = roomEx ) for room in rooms: print "=============================" print room Test.dalManager.disconnect()
def getReservations(): from MaKaC.rb_room import RoomBase Test.dalManager.connect() roomEx = Factory.newRoom() roomEx.name = "TH AMPHITHEATRE" resvEx = Factory.newReservation() resvEx.startDT = datetime(2006, 12, 01, 10) resvEx.endDT = datetime(2006, 12, 14, 15) # resvEx.bookedForName = 'Jean-Jacques Blais' resvs = ReservationBase.getReservations(resvExample=resvEx, rooms=[roomEx]) for resv in resvs: print "=============================" print resv Test.dalManager.disconnect()
def getAvailableRooms(): Test.dalManager.connect() from datetime import datetime roomEx = Factory.newRoom() roomEx.isActive = True roomEx.isReservable = True resvEx = Factory.newReservation() resvEx.startDT = datetime(2006, 12, 01, 10) resvEx.endDT = datetime(2006, 12, 14, 15) resvEx.repeatability = 0 # Daily rooms = RoomBase.getRooms(roomExample=roomEx, resvExample=resvEx, available=True) for room in rooms: print "\n=======================================\n" print room Test.dalManager.disconnect()
def getAvailableRooms(): Test.dalManager.connect() from datetime import datetime roomEx = Factory.newRoom() roomEx.isActive = True roomEx.isReservable = True resvEx = Factory.newReservation() resvEx.startDT = datetime( 2006, 12, 01, 10 ) resvEx.endDT = datetime( 2006, 12, 14, 15 ) resvEx.repeatability = 0 # Daily rooms = RoomBase.getRooms( \ roomExample = roomEx, resvExample = resvEx, available = True ) for room in rooms: print "\n=======================================\n" print room Test.dalManager.disconnect()