def returns_TicketLeap_for_ticketleap_urls(self): event = Event() urls = [r'http://tkt.ly/event/1695937595/efblike', r'riverstompmusicfestival.TICKETLEAP.com/riverstompmusicfestival/', r'http://tedxphilly.ticketleap.com/tedxphilly2011/t/b347fa25c2210005175bd2a87d0803f3/',] for url in urls: event.rsvp_url = url service_name = event.rsvp_service_name assert_equal(service_name, 'TicketLeap', "Expected service name 'TicketLeap' for url %r, received %r" % (url, service_name))
def returns_Eventbrite_for_eventbrite_urls(self): event = Event() urls = [r'http://www.eventbrite.com/event/1695937595/efblike', r'http://WWW.EVENTBRITE.COM/event/1695937595/efblike', r'https://www.eventbrite.com/event/1695937595/efblike',] for url in urls: event.rsvp_url = url service_name = event.rsvp_service_name assert_equal(service_name, 'Eventbrite', "Expected service name 'Eventbrite' for url %r, received %r" % (url, service_name))
def returns_Meetup_for_meetup_urls(self): event = Event() urls = [r'http://www.meetup.com/phillypug/events/33895172/', r'https://www.meetup.com/phillypug/events/33895172/', r'http://WWW.MEETUP.COM/phillypug/events/33895172/',] for url in urls: event.rsvp_url = url service_name = event.rsvp_service_name assert_equal(service_name, 'Meetup', "Expected service name 'Meetup' for url %r, received %r" % (url, service_name))
def returns_Facebook_for_facebook_urls(self): event = Event() urls = [r'http://www.facebook.com/event.php?eid=260448760649956', r'https://www.facebook.com/event.php?eid=260448760649956', r'https://WWW.FACEBOOK.COM/event.php?eid=260448760649956',] for url in urls: event.rsvp_url = url service_name = event.rsvp_service_name assert_equal(service_name, 'Facebook', "Expected service name 'Facebook' for url %r, received %r" % (url, service_name))
def return_None_for_urls_it_cant_handle(self): event = Event() urls = [r'http://www.google.com/event/1695937595/efblike', r'http://calendar.google.COM/event/1695937595/efblike', r'https://www.twitter.com/event/1695937595/efblike', r'www.fakefacebook.com/no-such-thing', r'fakefacebook.com/no-such-thing',] for url in urls: event.rsvp_url = url service_name = event.rsvp_service_name assert_is_none(service_name, "Expected service name None for url %r, received %r" % (url, service_name))
def returns_TicketLeap_for_ticketleap_urls(self): event = Event() urls = [ r'http://tkt.ly/event/1695937595/efblike', r'riverstompmusicfestival.TICKETLEAP.com/riverstompmusicfestival/', r'http://tedxphilly.ticketleap.com/tedxphilly2011/t/b347fa25c2210005175bd2a87d0803f3/', ] for url in urls: event.rsvp_url = url service_name = event.rsvp_service_name assert_equal( service_name, 'TicketLeap', "Expected service name 'TicketLeap' for url %r, received %r" % (url, service_name))
def returns_Eventbrite_for_eventbrite_urls(self): event = Event() urls = [ r'http://www.eventbrite.com/event/1695937595/efblike', r'http://WWW.EVENTBRITE.COM/event/1695937595/efblike', r'https://www.eventbrite.com/event/1695937595/efblike', ] for url in urls: event.rsvp_url = url service_name = event.rsvp_service_name assert_equal( service_name, 'Eventbrite', "Expected service name 'Eventbrite' for url %r, received %r" % (url, service_name))
def returns_Meetup_for_meetup_urls(self): event = Event() urls = [ r'http://www.meetup.com/phillypug/events/33895172/', r'https://www.meetup.com/phillypug/events/33895172/', r'http://WWW.MEETUP.COM/phillypug/events/33895172/', ] for url in urls: event.rsvp_url = url service_name = event.rsvp_service_name assert_equal( service_name, 'Meetup', "Expected service name 'Meetup' for url %r, received %r" % (url, service_name))
def returns_Facebook_for_facebook_urls(self): event = Event() urls = [ r'http://www.facebook.com/event.php?eid=260448760649956', r'https://www.facebook.com/event.php?eid=260448760649956', r'https://WWW.FACEBOOK.COM/event.php?eid=260448760649956', ] for url in urls: event.rsvp_url = url service_name = event.rsvp_service_name assert_equal( service_name, 'Facebook', "Expected service name 'Facebook' for url %r, received %r" % (url, service_name))
def return_None_for_urls_it_cant_handle(self): event = Event() urls = [ r'http://www.google.com/event/1695937595/efblike', r'http://calendar.google.COM/event/1695937595/efblike', r'https://www.twitter.com/event/1695937595/efblike', r'www.fakefacebook.com/no-such-thing', r'fakefacebook.com/no-such-thing', ] for url in urls: event.rsvp_url = url service_name = event.rsvp_service_name assert_is_none( service_name, "Expected service name None for url %r, received %r" % (url, service_name))
def returns_None_if_event_has_no_rsvpUrl(self): event = Event() event.rsvp_url = None assert_is_none(event.rsvp_service_name)