class TestStudySpaces(): def setUp(self): self.studyspaces = StudySpaces() def test_json(self): json_id = self.studyspaces.get_id_json() ok_(len(json_id) > 0) for i in json_id: ok_(i['id'] > 0) ok_(i['name'] != '') ok_(i['url'] != '') def test_extraction(self): dict_id = self.studyspaces.get_id_dict() ok_(len(dict_id) > 0) d = datetime.datetime.now() + datetime.timedelta(days=1) next_date = d.strftime("%Y-%m-%d") s = self.studyspaces.extract_times(1799, next_date, "Van Pelt-Dietrich Library Center Group Study Rooms") for i in s: ok_("building" in i) ok_("start_time" in i) ok_("end_time" in i) ok_("date" in i) ok_("room_name" in i)
class TestStudySpaces(): def setUp(self): from .credentials import LIBCAL_ID, LIBCAL_SECRET self.studyspaces = StudySpaces(LIBCAL_ID, LIBCAL_SECRET) def test_buildings(self): buildings = self.studyspaces.get_buildings() ok_(len(buildings) > 0) for location in buildings: ok_("lid" in location) ok_("name" in location) ok_("service" in location)
def setUp(self): self.studyspaces = StudySpaces()
from penn import Transit, Directory, Dining, DiningV2, Registrar, Map, Laundry, StudySpaces, Calendar, Fitness, Wharton from os import getenv din = Dining(getenv("DIN_USERNAME"), getenv("DIN_PASSWORD")) dinV2 = DiningV2(getenv("DIN_USERNAME"), getenv("DIN_PASSWORD")) reg = Registrar(getenv("REG_USERNAME"), getenv("REG_PASSWORD")) penn_dir = Directory(getenv("DIR_USERNAME"), getenv("DIR_PASSWORD")) map_search = Map(getenv("NEM_USERNAME"), getenv("NEM_PASSWORD")) transit = Transit(getenv("TRANSIT_USERNAME"), getenv("TRANSIT_PASSWORD")) laundry = Laundry() studyspaces = StudySpaces(getenv("LIBCAL_ID"), getenv("LIBCAL_SECRET")) wharton = Wharton() fitness = Fitness(getenv("FITNESS_TOKEN")) calendar = Calendar() wharton = Wharton() depts = { "AAMW": "Art & Arch of Med. World", "ACCT": "Accounting", "AFRC": "Africana Studies", "AFST": "African Studies Program", "ALAN": "Asian Languages", "AMCS": "Applied Math & Computatnl Sci.", "ANAT": "Anatomy", "ANCH": "Ancient History", "ANEL": "Ancient Near East Languages", "ANTH": "Anthropology", "ARAB": "Arabic", "ARCH": "Architecture", "ARTH": "Art History", "ASAM": "Asian American Studies", "ASTR": "Astronomy",
def setUp(self): from .credentials import LIBCAL_ID, LIBCAL_SECRET self.studyspaces = StudySpaces(LIBCAL_ID, LIBCAL_SECRET)