From cdfce9aaa56470cd5a1c61daa059a53c638be9d6 Mon Sep 17 00:00:00 2001 From: Eric Wang Date: Sat, 27 Jan 2018 11:43:36 -0500 Subject: [PATCH 1/4] #75, fix laundry tests --- tests/laundry_test.py | 59 ++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 32 deletions(-) diff --git a/tests/laundry_test.py b/tests/laundry_test.py index fceb72f..cc1c2a3 100644 --- a/tests/laundry_test.py +++ b/tests/laundry_test.py @@ -1,43 +1,38 @@ -from nose.tools import ok_, eq_ +from nose.tools import ok_ from penn import Laundry class TestLaundry(): def setUp(self): - pass - # self.laundry = Laundry() + self.laundry = Laundry() def test_all(self): - pass - # data = self.laundry.all_status() - # ok_(len(data) > 50) - # eq_('Class of 1925 House', data[0]['name']) - # # Check all halls have appropriate data points - # for i, hall in enumerate(data): - # # Not a valid check anymore because of New College House - # # eq_(hall['hall_no'], i) - # ok_(hall['dryers_available'] >= 0) - # ok_(hall['dryers_in_use'] >= 0) - # ok_(hall['washers_available'] >= 0) - # ok_(hall['washers_in_use'] >= 0) + data = self.laundry.all_status() + ok_(len(data) > 50) + ok_('Class of 1925' in data) + # Check all halls have appropriate data points + for i, hall in data.items(): + for t in ['washers', 'dryers']: + ok_("running" in hall[t]) + ok_("open" in hall[t]) def test_single_hall(self): - pass - # for i in range(1): - # data = self.laundry.hall_status(i) - # machines = data['machines'] - # # Check all machines have appropriate data points - # for i, machine in enumerate(machines): - # eq_(machine['number'], str(i + 1)) - # ok_('available' in machine) - # ok_('machine_type' in machine) - # ok_('time_left' in machine) + for i in range(3): + data = self.laundry.hall_status(i) + machines = data['machines'] + # Check for general hall information + ok_('washers' in machines) + ok_('dryers' in machines) + # Check all machines have appropriate data points + for machine in machines["details"]: + ok_('id' in machine) + ok_('type' in machine) + ok_('status' in machine) def test_usage(self): - pass - # for i in range(10): - # data = self.laundry.machine_usage(i) - # for j in data: - # ok_(j in self.laundry.days) - # for k in data[j]: - # ok_(k in self.laundry.busy_dict.values()) + for i in range(10): + data = self.laundry.machine_usage(i) + for j in data: + ok_(j in self.laundry.days) + for k in data[j]: + ok_(k in self.laundry.busy_dict.values()) From 35852ead64519c1f50ce5c3e9d663df97ac78786 Mon Sep 17 00:00:00 2001 From: Eric Wang Date: Sat, 27 Jan 2018 11:46:02 -0500 Subject: [PATCH 2/4] #75, uncomment directory tests --- tests/directory_test.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/directory_test.py b/tests/directory_test.py index 99031ea..aaec8b3 100644 --- a/tests/directory_test.py +++ b/tests/directory_test.py @@ -21,15 +21,15 @@ def test_lastname_search_standardized(self): self.assertEquals(len(person), 1) self.assertEquals(person[0]['result_data'][0]['detail_name'], "Adam W Domingoes") - # def test_person_id(self): - # # Alex Wissmann's person id - # details = self.dir.person_details('041cd6e739387e24db2483785b87b082')['result_data'] - # self.assertEquals(details[0]['detail_name'], "ADAM W DOMINGOES") - - # def test_person_id_standardized(self): - # # Alex Wissmann's person id - # details = self.dir.person_details('041cd6e739387e24db2483785b87b082', True)['result_data'] - # self.assertEquals(details[0]['detail_name'], "Adam W Domingoes") + def test_person_id(self): + # Alex Wissmann's person id + details = self.dir.person_details('041cd6e739387e24db2483785b87b082')['result_data'] + self.assertEquals(details[0]['detail_name'], "ADAM W DOMINGOES") + + def test_person_id_standardized(self): + # Alex Wissmann's person id + details = self.dir.person_details('041cd6e739387e24db2483785b87b082', True)['result_data'] + self.assertEquals(details[0]['detail_name'], "Adam W Domingoes") def test_faculty_name_not_standardized(self): fac = self.dir.search({'first_name': 'kostas'}) From a7506f415f4056da659e2f076e8762f859f30ddd Mon Sep 17 00:00:00 2001 From: Eric Wang Date: Sat, 27 Jan 2018 11:56:14 -0500 Subject: [PATCH 3/4] actually fix laundry test --- requirements.txt | 1 + tests/directory_test.py | 4 +- tests/laundry_snapshot.html | 6752 +++++++++++++++++++++++++++++++++++ tests/laundry_test.py | 12 + 4 files changed, 6767 insertions(+), 2 deletions(-) create mode 100644 tests/laundry_snapshot.html diff --git a/requirements.txt b/requirements.txt index 55853f9..30f7ee3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,5 @@ nose==1.3.4 requests==2.4.3 beautifulsoup4==4.4.1 html5lib==0.999 +mock==2.0.0 nameparser==0.4.0 diff --git a/tests/directory_test.py b/tests/directory_test.py index aaec8b3..c4cd951 100644 --- a/tests/directory_test.py +++ b/tests/directory_test.py @@ -12,12 +12,12 @@ def setUp(self): self.dir = directory.Directory(username, password) def test_lastname_search(self): - person = self.dir.detail_search({'last_name':'Domingoes'})['result_data'] + person = self.dir.detail_search({'last_name': 'Domingoes'})['result_data'] self.assertEquals(len(person), 1) self.assertEquals(person[0]['result_data'][0]['detail_name'], "ADAM W DOMINGOES") def test_lastname_search_standardized(self): - person = self.dir.detail_search({'last_name':'Domingoes'}, standardize=True)['result_data'] + person = self.dir.detail_search({'last_name': 'Domingoes'}, standardize=True)['result_data'] self.assertEquals(len(person), 1) self.assertEquals(person[0]['result_data'][0]['detail_name'], "Adam W Domingoes") diff --git a/tests/laundry_snapshot.html b/tests/laundry_snapshot.html new file mode 100644 index 0000000..907979c --- /dev/null +++ b/tests/laundry_snapshot.html @@ -0,0 +1,6752 @@ + + + + + + Wash Alert Web Interface + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Bishop/White

MachineTypeStatusTime RemainingNotification
Dryer #10DryerIn use
24 minutes left
+
+ + Email: + + +
+
Dryer #11DryerIn use
24 minutes left
+
+ + Email: + + +
+
Dryer #12DryerIn use
26 minutes left
+
+ + Email: + + +
+
Dryer #13DryerIn use
48 minutes left
+
+ + Email: + + +
+
Dryer #14DryerReady to start  
Dryer #15DryerReady to start  
Dryer #16DryerAvailable  
Dryer #17DryerEnd of cycle  
Dryer #18DryerAvailable  
Washer #1WasherEnd of cycle  
Washer #2WasherEnd of cycle  
Washer #3WasherReady to start  
Washer #4WasherAvailable  
Washer #5WasherIn use
16 minutes left
+
+ + Email: + + +
+
Washer #6WasherIn use
7 minutes left
+
+ + Email: + + +
+
Washer #7WasherReady to start  
Washer #8WasherOut of order  
Washer #9WasherReady to start  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Chestnut/Butcher

MachineTypeStatusTime RemainingNotification
Dryer #12DryerAvailable  
Dryer #13DryerReady to start  
Dryer #14DryerReady to start  
Dryer #15DryerAvailable  
Dryer #16DryerAvailable  
Dryer #17DryerReady to start  
Dryer #18DryerAvailable  
Dryer #19DryerReady to start  
Dryer #20DryerReady to start  
Dryer #21DryerAvailable  
Dryer #22DryerEnd of cycle  
Washer #01WasherAvailable  
Washer #02WasherEnd of cycle  
Washer #03WasherAvailable  
Washer #04WasherReady to start  
Washer #05WasherReady to start  
Washer #06WasherReady to start  
Washer #07WasherAvailable  
Washer #08WasherIn use
20 minutes left
+
+ + Email: + + +
+
Washer #09WasherReady to start  
Washer #10WasherIn use
8 minutes left
+
+ + Email: + + +
+
Washer #11WasherIn use
11 minutes left
+
+ + Email: + + +
+
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Class of 1925

MachineTypeStatusTime RemainingNotification
S/N 1703033557 (n002)WasherReady to start  
S/N 1703033560 (n003)WasherReady to start  
S/N 1703033561 (n004)WasherReady to start  
S/N 1703033563 (n001)WasherReady to start  
S/N 1704065276 (n006)DryerIn use
55 minutes left
+
+ + Email: + + +
+
S/N 1704065277 (n007)DryerIn use
15 minutes left
+
+ + Email: + + +
+
S/N 1704065280 (n008)DryerIn use
14 minutes left
+
+ + Email: + + +
+
S/N 1704065286 (n005)DryerIn use
24 minutes left
+
+ + Email: + + +
+
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Class of 1928/Fisher

MachineTypeStatusTime RemainingNotification
Dryer #09DryerAvailable  
Dryer #10DryerAvailable  
Dryer #11DryerAvailable  
Dryer #12DryerAvailable  
Dryer #13DryerIn use
72 minutes left
+
+ + Email: + + +
+
Dryer #14DryerIn use
72 minutes left
+
+ + Email: + + +
+
Dryer #15DryerAvailable  
Dryer #16DryerIn use
38 minutes left
+
+ + Email: + + +
+
Washer #1WasherIn use
21 minutes left
+
+ + Email: + + +
+
Washer #2WasherAvailable  
Washer #3WasherAvailable  
Washer #4WasherAvailable  
Washer #5WasherAvailable  
Washer #6WasherAvailable  
Washer #7WasherAvailable  
Washer #8WasherAvailable  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Craig

MachineTypeStatusTime RemainingNotification
Dryer #4DryerAvailable  
Dryer #5DryerIn use
20 minutes left
+
+ + Email: + + +
+
Dryer #6DryerIn use
22 minutes left
+
+ + Email: + + +
+
Washer #1WasherEnd of cycle  
Washer #2WasherEnd of cycle  
Washer #3WasherOut of order  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

DuBois

MachineTypeStatusTime RemainingNotification
Dryer #07DryerEnd of cycle  
Dryer #08DryerIn use
45 minutes left
+
+ + Email: + + +
+
Dryer #09DryerIn use
44 minutes left
+
+ + Email: + + +
+
Dryer #10DryerIn use
50 minutes left
+
+ + Email: + + +
+
Dryer #11DryerEnd of cycle  
Dryer #12DryerEnd of cycle  
Washer #1WasherReady to start  
Washer #2WasherAvailable  
Washer #3WasherAvailable  
Washer #4WasherAvailable  
Washer #5WasherIn use
30 minutes left
+
+ + Email: + + +
+
Washer #6WasherIn use
30 minutes left
+
+ + Email: + + +
+
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

English House

MachineTypeStatusTime RemainingNotification
Dryer #4DryerEnd of cycle  
Dryer #5DryerAlmost done
1 minutes left
+
+ + Email: + + +
+
Dryer #6DryerEnd of cycle  
Washer #1WasherAlmost done
2 minutes left
+
+ + Email: + + +
+
Washer #2WasherIn use
11 minutes left
+
+ + Email: + + +
+
Washer #3WasherIn use
15 minutes left
+
+ + Email: + + +
+
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Harnwell Floor 02

MachineTypeStatusTime RemainingNotification
Dryer #67DryerReady to start  
Dryer #68DryerReady to start  
Dryer #69DryerReady to start  
Washer #70WasherReady to start  
Washer #71WasherEnd of cycle  
Washer #72WasherEnd of cycle  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Harnwell Floor 04

MachineTypeStatusTime RemainingNotification
Dryer #61DryerIn use
48 minutes left
+
+ + Email: + + +
+
Dryer #62DryerIn use
48 minutes left
+
+ + Email: + + +
+
Dryer #63DryerIn use
34 minutes left
+
+ + Email: + + +
+
Washer #64WasherReady to start  
Washer #65WasherReady to start  
Washer #66WasherAvailable  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Harnwell Floor 06

MachineTypeStatusTime RemainingNotification
Dryer #55DryerEnd of cycle  
Dryer #56DryerReady to start  
Dryer #57DryerReady to start  
Washer #58WasherIn use
21 minutes left
+
+ + Email: + + +
+
Washer #59WasherIn use
18 minutes left
+
+ + Email: + + +
+
Washer #60WasherIn use
27 minutes left
+
+ + Email: + + +
+
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Harnwell Floor 08

MachineTypeStatusTime RemainingNotification
Dryer #49DryerReady to start  
Dryer #50DryerAvailable  
Dryer #51DryerReady to start  
Washer #52WasherAvailable  
Washer #53WasherReady to start  
Washer #54WasherReady to start  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Harnwell Floor 10

MachineTypeStatusTime RemainingNotification
Dryer #43DryerAvailable  
Dryer #44DryerIn use
36 minutes left
+
+ + Email: + + +
+
Dryer #45DryerIn use
23 minutes left
+
+ + Email: + + +
+
Washer #46WasherAvailable  
Washer #47WasherAvailable  
Washer #48WasherIn use
25 minutes left
+
+ + Email: + + +
+
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Harnwell Floor 12

MachineTypeStatusTime RemainingNotification
Dryer #37DryerEnd of cycle  
Dryer #38DryerEnd of cycle  
Dryer #39DryerEnd of cycle  
Washer #40WasherAvailable  
Washer #41WasherReady to start  
Washer #42WasherReady to start  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Harnwell Floor 14

MachineTypeStatusTime RemainingNotification
Dryer #31DryerIn use
31 minutes left
+
+ + Email: + + +
+
Dryer #32DryerIn use
33 minutes left
+
+ + Email: + + +
+
Dryer #33DryerAvailable  
Washer #34WasherIn use
13 minutes left
+
+ + Email: + + +
+
Washer #35WasherIn use
27 minutes left
+
+ + Email: + + +
+
Washer #36WasherAvailable  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Harnwell Floor 16

MachineTypeStatusTime RemainingNotification
Dryer #25DryerReady to start  
Dryer #26DryerIn use
53 minutes left
+
+ + Email: + + +
+
Dryer #27DryerIn use
53 minutes left
+
+ + Email: + + +
+
Washer #28WasherAvailable  
Washer #29WasherAvailable  
Washer #30WasherAvailable  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Harnwell Floor 18

MachineTypeStatusTime RemainingNotification
Dryer #19DryerAvailable  
Dryer #20DryerAvailable  
Dryer #21DryerAvailable  
Washer #22WasherAvailable  
Washer #23WasherAvailable  
Washer #24WasherAvailable  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Harnwell Floor 20

MachineTypeStatusTime RemainingNotification
Dryer #13DryerReady to start  
Dryer #14DryerOut of order  
Dryer #15DryerReady to start  
Washer #16WasherAvailable  
Washer #17WasherReady to start  
Washer #18WasherAvailable  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Harnwell Floor 22

MachineTypeStatusTime RemainingNotification
Dryer #7DryerReady to start  
Dryer #8DryerEnd of cycle  
Dryer #9DryerEnd of cycle  
Washer #10WasherIn use
22 minutes left
+
+ + Email: + + +
+
Washer #11WasherReady to start  
Washer #12WasherAvailable  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Harnwell Floor 24

MachineTypeStatusTime RemainingNotification
Dryer #1DryerIn use  
Dryer #2DryerIn use
38 minutes left
+
+ + Email: + + +
+
Dryer #3DryerAvailable  
Washer #4WasherAvailable  
Washer #5WasherAlmost done
1 minutes left
+
+ + Email: + + +
+
Washer #6WasherAvailable  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Harrison Floor 02

MachineTypeStatusTime RemainingNotification
S/N 1705010809 (n069)DryerReady to start  
S/N 1705010812 (n068)DryerIn use
53 minutes left
+
+ + Email: + + +
+
S/N 1707000910 (n067)DryerReady to start  
S/N 1707014148 (n071)WasherReady to start  
S/N 1707014158 (n070)WasherAvailable  
S/N 1707014176 (n072)WasherEnd of cycle  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Harrison Floor 04

MachineTypeStatusTime RemainingNotification
Dryer #61DryerAvailable  
Dryer #62DryerIn use
28 minutes left
+
+ + Email: + + +
+
Dryer #63DryerAvailable  
Washer #64WasherReady to start  
Washer #65WasherReady to start  
Washer #66WasherReady to start  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Harrison Floor 06

MachineTypeStatusTime RemainingNotification
Dryer #55DryerReady to start  
Dryer #56DryerEnd of cycle  
Dryer #57DryerEnd of cycle  
Washer #58WasherReady to start  
Washer #59WasherIn use
16 minutes left
+
+ + Email: + + +
+
Washer #60WasherIn use
17 minutes left
+
+ + Email: + + +
+
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Harrison Floor 08

MachineTypeStatusTime RemainingNotification
Dryer #49DryerAvailable  
Dryer #50DryerAvailable  
Dryer #51DryerEnd of cycle  
Washer #52WasherReady to start  
Washer #53WasherReady to start  
Washer #54WasherReady to start  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Harrison Floor 10

MachineTypeStatusTime RemainingNotification
Dryer #43DryerAvailable  
Dryer #44DryerIn use
40 minutes left
+
+ + Email: + + +
+
Dryer #45DryerIn use
51 minutes left
+
+ + Email: + + +
+
Washer #46WasherReady to start  
Washer #47WasherReady to start  
Washer #48WasherReady to start  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Harrison Floor 12

MachineTypeStatusTime RemainingNotification
Dryer #37DryerEnd of cycle  
Dryer #38DryerAvailable  
Dryer #39DryerAvailable  
Washer #40WasherReady to start  
Washer #41WasherReady to start  
Washer #42WasherReady to start  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Harrison Floor 14

MachineTypeStatusTime RemainingNotification
Dryer #31DryerReady to start  
Dryer #32DryerAvailable  
Dryer #33DryerAvailable  
Washer #34WasherIn use
34 minutes left
+
+ + Email: + + +
+
Washer #35WasherEnd of cycle  
Washer #36WasherIn use
33 minutes left
+
+ + Email: + + +
+
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Harrison Floor 16

MachineTypeStatusTime RemainingNotification
Dryer #25DryerReady to start  
Dryer #26DryerReady to start  
Dryer #27DryerReady to start  
Washer #28WasherReady to start  
Washer #29WasherReady to start  
Washer #30WasherReady to start  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Harrison Floor 18

MachineTypeStatusTime RemainingNotification
Dryer #19DryerIn use
46 minutes left
+
+ + Email: + + +
+
Dryer #20DryerEnd of cycle  
Dryer #21DryerReady to start  
Washer #22WasherReady to start  
Washer #23WasherReady to start  
Washer #24WasherReady to start  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Harrison Floor 20

MachineTypeStatusTime RemainingNotification
Dryer #13DryerReady to start  
Dryer #14DryerIn use
26 minutes left
+
+ + Email: + + +
+
Dryer #15DryerIn use
26 minutes left
+
+ + Email: + + +
+
Washer #16WasherAvailable  
Washer #17WasherReady to start  
Washer #18WasherReady to start  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Harrison Floor 22

MachineTypeStatusTime RemainingNotification
Dryer #7DryerAvailable  
Dryer #8DryerReady to start  
Dryer #9DryerReady to start  
Washer #10WasherIn use
9 minutes left
+
+ + Email: + + +
+
Washer #11WasherReady to start  
Washer #12WasherReady to start  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Harrison Floor 24

MachineTypeStatusTime RemainingNotification
Dryer #1DryerAvailable  
Dryer #2DryerAvailable  
Dryer #3DryerIn use
5 minutes left
+
+ + Email: + + +
+
Washer #4WasherAvailable  
Washer #5WasherReady to start  
Washer #6WasherAvailable  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Hill House

MachineTypeStatusTime RemainingNotification
Dryer #17DryerAvailable  
Dryer #18DryerIn use
21 minutes left
+
+ + Email: + + +
+
Dryer #19DryerIn use
42 minutes left
+
+ + Email: + + +
+
Dryer #20DryerAvailable  
Dryer #21DryerReady to start  
Dryer #22DryerAvailable  
Dryer #23DryerAvailable  
Dryer #24DryerAvailable  
Dryer #25DryerReady to start  
Dryer #26DryerAvailable  
Dryer #27DryerReady to start  
Dryer #28DryerAvailable  
Dryer #29DryerAvailable  
Dryer #30DryerAvailable  
Dryer #31DryerReady to start  
Dryer #32DryerIn use
27 minutes left
+
+ + Email: + + +
+
Washer #01WasherReady to start  
Washer #02WasherEnd of cycle  
Washer #03WasherIn use
22 minutes left
+
+ + Email: + + +
+
Washer #04WasherIn use
22 minutes left
+
+ + Email: + + +
+
Washer #05WasherEnd of cycle  
Washer #06WasherEnd of cycle  
Washer #07WasherEnd of cycle  
Washer #08WasherEnd of cycle  
Washer #09WasherOut of order  
Washer #10WasherIn use
31 minutes left
+
+ + Email: + + +
+
Washer #11WasherAvailable  
Washer #12WasherReady to start  
Washer #13WasherEnd of cycle  
Washer #14WasherEnd of cycle  
Washer #15WasherIn use
23 minutes left
+
+ + Email: + + +
+
Washer #16WasherIn use
23 minutes left
+
+ + Email: + + +
+
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Kings Court

MachineTypeStatusTime RemainingNotification
S/N 1705000572 (n004)WasherIn use
19 minutes left
+
+ + Email: + + +
+
S/N 1705007351 (n001)WasherIn use
19 minutes left
+
+ + Email: + + +
+
S/N 1705021687 (n003)WasherIn use
19 minutes left
+
+ + Email: + + +
+
S/N 1705021688 (n005)WasherIn use
13 minutes left
+
+ + Email: + + +
+
S/N 1705021689 (n002)WasherIn use
18 minutes left
+
+ + Email: + + +
+
+
+ + Email: + Notify me when there are + + washers available. + +
+

Magee/Amhurst

MachineTypeStatusTime RemainingNotification
Dryer #13DryerAvailable  
Dryer #14DryerAvailable  
Dryer #15DryerAvailable  
Dryer #16DryerAvailable  
Dryer #17DryerAvailable  
Dryer #18DryerIn use
53 minutes left
+
+ + Email: + + +
+
Dryer #19DryerIn use
52 minutes left
+
+ + Email: + + +
+
Dryer #20DryerAvailable  
Dryer #21DryerEnd of cycle  
Dryer #22DryerEnd of cycle  
Dryer #23DryerAvailable  
Dryer #24DryerEnd of cycle  
Washer #01WasherAvailable  
Washer #02WasherAvailable  
Washer #03WasherAvailable  
Washer #04WasherAvailable  
Washer #05WasherIn use
11 minutes left
+
+ + Email: + + +
+
Washer #06WasherReady to start  
Washer #07WasherAvailable  
Washer #08WasherAvailable  
Washer #09WasherEnd of cycle  
Washer #10WasherEnd of cycle  
Washer #11WasherEnd of cycle  
Washer #12WasherOut of order  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Mayer

MachineTypeStatusTime RemainingNotification
Dryer #09DryerReady to start  
Dryer #10DryerReady to start  
Dryer #11DryerIn use
15 minutes left
+
+ + Email: + + +
+
Dryer #12DryerReady to start  
Dryer #13DryerIn use
31 minutes left
+
+ + Email: + + +
+
Dryer #14DryerReady to start  
Dryer #15DryerReady to start  
Dryer #16DryerReady to start  
Washer #01WasherEnd of cycle  
Washer #02WasherEnd of cycle  
Washer #03WasherAvailable  
Washer #04WasherEnd of cycle  
Washer #05WasherReady to start  
Washer #06WasherReady to start  
Washer #07WasherEnd of cycle  
Washer #08WasherEnd of cycle  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Morgan

MachineTypeStatusTime RemainingNotification
Dryer #03DryerIn use  
Dryer #04DryerIn use  
Washer #1WasherReady to start  
Washer #2WasherIn use
11 minutes left
+
+ + Email: + + +
+
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

New College House

MachineTypeStatusTime RemainingNotification
S/N 1704059247 (n020)DryerEnd of cycle  
S/N 1705000370 (n009)DryerIn use
42 minutes left
+
+ + Email: + + +
+
S/N 1705000370 (n010)WasherAvailable  
S/N 1705000371 (n017)DryerAvailable  
S/N 1705000371 (n018)WasherIn use
30 minutes left
+
+ + Email: + + +
+
S/N 1705000372 (n007)DryerIn use
41 minutes left
+
+ + Email: + + +
+
S/N 1705000372 (n008)WasherAvailable  
S/N 1705000373 (n003)DryerAvailable  
S/N 1705000373 (n004)WasherIn use
5 minutes left
+
+ + Email: + + +
+
S/N 1705000374 (n005)DryerAvailable  
S/N 1705000374 (n006)WasherAvailable  
S/N 1705000375 (n015)DryerEnd of cycle  
S/N 1705000375 (n016)WasherIn use
30 minutes left
+
+ + Email: + + +
+
S/N 1705000376 (n011)DryerAvailable  
S/N 1705000376 (n012)WasherAvailable  
S/N 1705000377 (n013)DryerIn use
13 minutes left
+
+ + Email: + + +
+
S/N 1705000377 (n014)WasherAvailable  
S/N 1705000378 (n001)DryerAvailable  
S/N 1705000378 (n002)WasherIn use
8 minutes left
+
+ + Email: + + +
+
S/N 1705000438 (n019)WasherReady to start  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Rodin Floor 02

MachineTypeStatusTime RemainingNotification
Dryer #67DryerEnd of cycle  
Dryer #68DryerAvailable  
Dryer #69DryerAvailable  
Washer #70WasherAvailable  
Washer #71WasherReady to start  
Washer #72WasherAvailable  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Rodin Floor 04

MachineTypeStatusTime RemainingNotification
Dryer #61DryerReady to start  
Dryer #62DryerIn use
88 minutes left
+
+ + Email: + + +
+
Dryer #63DryerIn use
49 minutes left
+
+ + Email: + + +
+
Washer #64WasherReady to start  
Washer #65WasherAvailable  
Washer #66WasherAvailable  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Rodin Floor 06

MachineTypeStatusTime RemainingNotification
Dryer #55DryerAvailable  
Dryer #56DryerReady to start  
Dryer #57DryerAvailable  
Washer #58WasherAvailable  
Washer #59WasherAvailable  
Washer #60WasherReady to start  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Rodin Floor 08

MachineTypeStatusTime RemainingNotification
Dryer #49DryerReady to start  
Dryer #50DryerReady to start  
Dryer #51DryerAvailable  
Washer #52WasherAvailable  
Washer #53WasherIn use
30 minutes left
+
+ + Email: + + +
+
Washer #54WasherIn use
30 minutes left
+
+ + Email: + + +
+
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Rodin Floor 10

MachineTypeStatusTime RemainingNotification
Dryer #43DryerReady to start  
Dryer #44DryerAvailable  
Dryer #45DryerReady to start  
Washer #46WasherIn use
10 minutes left
+
+ + Email: + + +
+
Washer #47WasherIn use
9 minutes left
+
+ + Email: + + +
+
Washer #48WasherIn use
13 minutes left
+
+ + Email: + + +
+
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Rodin Floor 12

MachineTypeStatusTime RemainingNotification
Dryer #37DryerReady to start  
Dryer #38DryerAvailable  
Dryer #39DryerEnd of cycle  
Washer #40WasherReady to start  
Washer #41WasherAvailable  
Washer #42WasherAvailable  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Rodin Floor 14

MachineTypeStatusTime RemainingNotification
Dryer #31DryerIn use
17 minutes left
+
+ + Email: + + +
+
Dryer #32DryerIn use
7 minutes left
+
+ + Email: + + +
+
Dryer #33DryerAlmost done
4 minutes left
+
+ + Email: + + +
+
Washer #34WasherReady to start  
Washer #35WasherReady to start  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Rodin Floor 16

MachineTypeStatusTime RemainingNotification
Dryer #25DryerIn use
50 minutes left
+
+ + Email: + + +
+
Dryer #26DryerReady to start  
Dryer #27DryerReady to start  
Washer #28WasherReady to start  
Washer #29WasherReady to start  
Washer #30WasherReady to start  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Rodin Floor 18

MachineTypeStatusTime RemainingNotification
Dryer #19DryerIn use
59 minutes left
+
+ + Email: + + +
+
Dryer #20DryerIn use
8 minutes left
+
+ + Email: + + +
+
Dryer #21DryerIn use
31 minutes left
+
+ + Email: + + +
+
Washer #22WasherIn use
14 minutes left
+
+ + Email: + + +
+
Washer #23WasherIn use
11 minutes left
+
+ + Email: + + +
+
Washer #24WasherEnd of cycle  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Rodin Floor 20

MachineTypeStatusTime RemainingNotification
Dryer #13DryerReady to start  
Dryer #14DryerReady to start  
Dryer #15DryerIn use
32 minutes left
+
+ + Email: + + +
+
Washer #16WasherIn use
34 minutes left
+
+ + Email: + + +
+
Washer #17WasherEnd of cycle  
Washer #18WasherIn use
5 minutes left
+
+ + Email: + + +
+
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Rodin Floor 22

MachineTypeStatusTime RemainingNotification
Dryer #07DryerReady to start  
Dryer #08DryerAvailable  
Dryer #09DryerAvailable  
Washer #10WasherAvailable  
Washer #11WasherIn use
16 minutes left
+
+ + Email: + + +
+
Washer #12WasherReady to start  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Rodin Floor 24

MachineTypeStatusTime RemainingNotification
Dryer #01DryerReady to start  
Dryer #02DryerReady to start  
Dryer #03DryerReady to start  
Washer #04WasherAvailable  
Washer #05WasherIn use
13 minutes left
+
+ + Email: + + +
+
Washer #06WasherAvailable  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Sansom East

MachineTypeStatusTime RemainingNotification
Dryer #17DryerEnd of cycle  
Dryer #18DryerIn use  
Dryer #19DryerAvailable  
Dryer #20DryerAvailable  
Dryer #21DryerAvailable  
Dryer #22DryerEnd of cycle  
Dryer #23DryerIn use
14 minutes left
+
+ + Email: + + +
+
Dryer #24DryerIn use
14 minutes left
+
+ + Email: + + +
+
Dryer #25DryerEnd of cycle  
Dryer #26DryerReady to start  
Dryer #27DryerReady to start  
Dryer #28DryerIn use
14 minutes left
+
+ + Email: + + +
+
Dryer #29DryerReady to start  
Dryer #30DryerAvailable  
Dryer #31DryerReady to start  
Dryer #32DryerAvailable  
Washer #01WasherAvailable  
Washer #02WasherReady to start  
Washer #03WasherReady to start  
Washer #04WasherReady to start  
Washer #05WasherReady to start  
Washer #06WasherAvailable  
Washer #07WasherIn use
10 minutes left
+
+ + Email: + + +
+
Washer #08WasherIn use
12 minutes left
+
+ + Email: + + +
+
Washer #09WasherEnd of cycle  
Washer #10WasherEnd of cycle  
Washer #11WasherEnd of cycle  
Washer #12WasherEnd of cycle  
Washer #13WasherEnd of cycle  
Washer #14WasherAvailable  
Washer #15WasherEnd of cycle  
Washer #16WasherEnd of cycle  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Sansom West

MachineTypeStatusTime RemainingNotification
Dryer #17DryerNot online  
Dryer #18DryerReady to start  
Dryer #19DryerEnd of cycle  
Dryer #20DryerReady to start  
Dryer #21DryerNot online  
Dryer #22DryerAvailable  
Dryer #23DryerReady to start  
Dryer #24DryerAvailable  
Dryer #25DryerAvailable  
Dryer #26DryerAvailable  
Dryer #27DryerReady to start  
Dryer #28DryerAvailable  
Dryer #29DryerReady to start  
Dryer #30DryerNot online  
Dryer #31DryerAvailable  
Dryer #32DryerReady to start  
Washer #01WasherOut of order  
Washer #02WasherEnd of cycle  
Washer #03WasherReady to start  
Washer #04WasherReady to start  
Washer #05WasherReady to start  
Washer #06WasherAvailable  
Washer #07WasherAvailable  
Washer #08WasherAvailable  
Washer #09WasherAvailable  
Washer #10WasherAvailable  
Washer #11WasherAvailable  
Washer #12WasherAvailable  
Washer #13WasherAvailable  
Washer #14WasherAvailable  
Washer #15WasherAvailable  
Washer #16WasherAvailable  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Stouffer Commons

MachineTypeStatusTime RemainingNotification
S/N 1706074152 (n008)WasherReady to start  
S/N 1706074156 (n012)WasherAvailable  
S/N 1706074159 (n011)WasherAlmost done
3 minutes left
+
+ + Email: + + +
+
S/N 1706074171 (n007)WasherEnd of cycle  
S/N 1707000700 (n010)WasherIn use
9 minutes left
+
+ + Email: + + +
+
S/N 1707000701 (n009)WasherAvailable  
S/N 1707005064 (n001)DryerReady to start  
S/N 1707005064 (n002)DryerReady to start  
S/N 1707005065 (n003)DryerEnd of cycle  
S/N 1707005065 (n004)DryerEnd of cycle  
S/N 1707005066 (n005)DryerReady to start  
S/N 1707005066 (n006)DryerAvailable  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+

Van Pelt

MachineTypeStatusTime RemainingNotification
S/N 1611052933 (n001)WasherAvailable  
S/N 1703033562 (n003)WasherReady to start  
S/N 1703033564 (n004)WasherReady to start  
S/N 1703033566 (n005)WasherReady to start  
S/N 1703033579 (n006)WasherReady to start  
S/N 1703033580 (n002)WasherReady to start  
S/N 1704065269 (n011)DryerIn use
9 minutes left
+
+ + Email: + + +
+
S/N 1704065271 (n007)DryerEnd of cycle  
S/N 1704065273 (n008)DryerAvailable  
S/N 1704065275 (n010)DryerEnd of cycle  
S/N 1704065278 (n009)DryerEnd of cycle  
S/N 1704065282 (n012)DryerReady to start  
+
+ + Email: + Notify me when there are + + washers and + + dryers available. + +
+
+ + +
© Alliance Laundry Systems LLC | PO Box 990 Shepard Street, Ripon, WI 54971 USA | Telephone: 1-920-748-3121
+
+
+ + diff --git a/tests/laundry_test.py b/tests/laundry_test.py index cc1c2a3..0244657 100644 --- a/tests/laundry_test.py +++ b/tests/laundry_test.py @@ -1,3 +1,5 @@ +import mock + from nose.tools import ok_ from penn import Laundry @@ -6,6 +8,15 @@ class TestLaundry(): def setUp(self): self.laundry = Laundry() + def fakeLaundryGet(url, *args, **kwargs): + if "suds.kite.upenn.edu" in url: + with open("tests/laundry_snapshot.html", "rb") as f: + m = mock.MagicMock(content=f.read()) + return m + else: + raise NotImplementedError + + @mock.patch("requests.get", fakeLaundryGet) def test_all(self): data = self.laundry.all_status() ok_(len(data) > 50) @@ -16,6 +27,7 @@ def test_all(self): ok_("running" in hall[t]) ok_("open" in hall[t]) + @mock.patch("requests.get", fakeLaundryGet) def test_single_hall(self): for i in range(3): data = self.laundry.hall_status(i) From 2cdea8fa115a613bfcff42d2109a94b8fceabd23 Mon Sep 17 00:00:00 2001 From: Eric Wang Date: Sat, 27 Jan 2018 12:05:26 -0500 Subject: [PATCH 4/4] fix #77, add environment variable for laundry domain --- penn/laundry.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/penn/laundry.py b/penn/laundry.py index b644223..701f758 100644 --- a/penn/laundry.py +++ b/penn/laundry.py @@ -1,10 +1,12 @@ import re +import os import csv import requests import pkg_resources from bs4 import BeautifulSoup -ALL_URL = 'http://suds.kite.upenn.edu/?location=' +LAUNDRY_DOMAIN = os.environ.get("LAUNDRY_DOMAIN", "suds.kite.upenn.edu") +ALL_URL = 'http://{}/?location='.format(LAUNDRY_DOMAIN) USAGE_BASE_URL = 'https://www.laundryalert.com/cgi-bin/penn6389/LMRoomUsage?CallingPage=LMRoom&Password=penn6389&Halls='