Skip to content

Commit

Permalink
Merge pull request #90 from pennlabs/laundryfix
Browse files Browse the repository at this point in the history
Fix laundry and directory tests
  • Loading branch information
ezwang authored Jan 27, 2018
2 parents 00b5a3e + 2cdea8f commit 96011fe
Show file tree
Hide file tree
Showing 5 changed files with 6,805 additions and 43 deletions.
4 changes: 3 additions & 1 deletion penn/laundry.py
Original file line number Diff line number Diff line change
@@ -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='


Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
20 changes: 10 additions & 10 deletions tests/directory_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ 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")

# 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(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_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'})
Expand Down
Loading

0 comments on commit 96011fe

Please sign in to comment.