コード例 #1
0
 def setUp(self):
     Peris = pL.getPeripherals()
     for Peri in Peris:
         if str.startswith(Peri['name'], "Test"):
             pL.deletePeripheral(Peri['uuid'])
     Rooms = pL.getRooms()
     for Room in Rooms:
         if Room['floor'] == "PTest":
             pL.deleteRoom(Room['uuid'])
コード例 #2
0
 def test_getRooms(
     self
 ):  # add two rooms, attempt to get all rooms, confim presence of both
     ruuid1 = pL.insertRoom("Test Room #3", "3", "Test")
     ruuid2 = pL.insertRoom("Test Room #4", "4", "Test")
     rooms = pL.getRooms()
     presence = 0
     for room in rooms:
         if room['uuid'] == ruuid1 or room['uuid'] == ruuid2:
             presence = presence + 1
     self.assertTrue(presence == 2)
コード例 #3
0
 def setUp(self):
     Ts = pL.getTransactions()
     for T in Ts:
         pL.deleteTransaction(T['uuid'])
     Users = pL.getUsers()
     for user in Users:
         if str.startswith(user['email'], "TestingEmail"):
             pL.deleteUser(user['uuid'])
     Rooms = pL.getRooms()
     for room in Rooms:
         if str.startswith(room['floor'], "Test"):
             pL.deleteRoom(room['uuid'])
     self._user = pL.insertUser("*****@*****.**")
     self._room = pL.insertRoom("Test Room", "12", "Test")
コード例 #4
0
 def setUp(self):
     RSR = pL.getMaintenanceRequests()
     for rsr in RSR:
         pL.deleteMaintenanceRequest(rsr['uuid'])
     Users = pL.getUsers()
     for user in Users:
         if str.startswith(user['email'], "TestingEmail"):
             pL.deleteUser(user['uuid'])
     Rooms = pL.getRooms()
     for room in Rooms:
         if str.startswith(room['floor'], "Test"):
             pL.deleteRoom(room['uuid'])
     self._user = pL.insertUser("*****@*****.**")
     self._room = pL.insertRoom("Test Room", "12", "Test")
コード例 #5
0
 def setUp(self):
     Rs = pL.getReservations()
     for R in Rs:
         pL.deleteReservation(R['uuid'])
     Guests = pL.getGuests()
     for guest in Guests:
         if str.startswith(guest['last_name'], "TestReservation"):
             pL.deleteGuest(guest['uuid'])
     Rooms = pL.getRooms()
     for room in Rooms:
         if str.startswith(room['floor'], "Test"):
             pL.deleteRoom(room['uuid'])
     self._guest = pL.insertGuest("Sam", "A.", "TestReservation",
                                  "*****@*****.**", "555-1234",
                                  "12 Test Lane", "Testville", "Tenesse",
                                  "00022")
     self._room = pL.insertRoom("Test Room", "12", "Test")
コード例 #6
0
 def setUp(self):
     RSR = pL.getRoomServiceRequests()
     for rsr in RSR:
         pL.deleteRoomServiceRequest(rsr['uuid'])
     Users = pL.getUsers()
     for user in Users:
         if str.startswith(user['email'], "TestingEmail"):
             pL.deleteUser(user['uuid'])
     Rooms = pL.getRooms()
     for room in Rooms:
         if str.startswith(room['floor'], "Test"):
             pL.deleteRoom(room['uuid'])
     TPs = pL.getRoomServiceItems()
     for TP in TPs:
         if str.startswith(TP['name'], "Test"):
             pL.deleteRoomServiceItem(TP['uuid'])
     self._user = pL.insertUser("*****@*****.**")
     self._room = pL.insertRoom("Test Room", "12", "Test")
     self._type = pL.insertRoomServiceItem("Test Room Service Item 6",
                                           "Description", "3.50", None,
                                           "0000123")
コード例 #7
0
def getRooms():
    rooms = pL.getRooms()
    for room in rooms:
        print(room)
    return jsonify({'rooms': rooms})
コード例 #8
0
 def setUp(self):
     Rooms = pL.getRooms()
     for Room in Rooms:
         if Room['floor'] == "Test":
             pL.deleteRoom(Room['uuid'])