def test_venue_address(paid_meetup_event_json): """Test getting the venue address from Meetup event JSON.""" meetup_event = MeetupEvent(paid_meetup_event_json) expected_venue = MeetupVenue("Nova Labs Inc.", "1916 Isaac Newton Square W", "Reston", "VA", "20190") assert meetup_event.venue == expected_venue
def test_photo_url(free_meetup_event_json): """Test getting the highest resolution featured photo URL.""" meetup_event = MeetupEvent(free_meetup_event_json) assert ( meetup_event.photo_url == "https://secure.meetupstatic.com/photos/event/6/b/4/9/highres_491187465.jpeg" )
def free_meetup_event(free_meetup_event_json): return MeetupEvent(free_meetup_event_json)
def test_photo_url_missing(paid_meetup_event_json): """Test getting the missing highest resolution featured photo URL.""" meetup_event = MeetupEvent(paid_meetup_event_json) assert meetup_event.photo_url is None
def test_duration(free_meetup_event_json): """Test getting the duration from Meetup event JSON.""" meetup_event = MeetupEvent(free_meetup_event_json) assert meetup_event.duration == 7200000
def paid_event_adaptor(paid_meetup_event_json): meetup_event = MeetupEvent(paid_meetup_event_json) return MeetupToApricotEventAdaptor(meetup_event, None, EXPECTED_TAGS)
def test_name(free_meetup_event_json): """Test getting the name from Meetup event JSON.""" meetup_event = MeetupEvent(free_meetup_event_json) assert meetup_event.name == "AC: Mending Monday (Test Event)"
def much_later_free_meetup_event(much_later_free_meetup_event_json): return MeetupEvent(much_later_free_meetup_event_json)
def test_find_us(free_meetup_event_json): """Test getting the find us from Meetup event JSON.""" meetup_event = MeetupEvent(free_meetup_event_json) assert ( meetup_event.find_us == "https://zoom.us/j/92758362882?pwd=a2VJOGxyOTBqelNhdjY1dGpqZStjZz09")
def test_meetup_id(free_meetup_event_json): """Test getting the meetup ID from Meetup event JSON.""" meetup_event = MeetupEvent(free_meetup_event_json) assert meetup_event.meetup_id == "pfsbvrybcpbmb"
def test_end_time(free_meetup_event_json): """Test getting the end time from Meetup event JSON.""" meetup_event = MeetupEvent(free_meetup_event_json) assert meetup_event.end_time == datetime.fromisoformat( "2020-11-09 21:00 -05:00")
def test_accounting_codes_multiple(): """Test getting multiple accounting codes.""" meetup_event = MeetupEvent({"name": "BL_MW_X: Two codes in event name"}) assert meetup_event.accounting_codes == ["BL", "MW", "X"]
def test_accounting_codes_missing(): """Test getting a missing accounting code.""" meetup_event = MeetupEvent({"name": "NO code in event name"}) assert meetup_event.accounting_codes == []
def longer_free_meetup_event(longer_free_meetup_event_json): return MeetupEvent(longer_free_meetup_event_json)
def test_later_start_time(later_free_meetup_event_json): """Test getting the start time from Meetup event JSON.""" meetup_event = MeetupEvent(later_free_meetup_event_json) assert meetup_event.start_time == datetime.fromisoformat( "2020-11-16 19:00 -05:00")
def later_free_meetup_event(later_free_meetup_event_json): return MeetupEvent(later_free_meetup_event_json)
def test_venue_online(free_meetup_event_json): """Test getting the online venue from Meetup event JSON.""" meetup_event = MeetupEvent(free_meetup_event_json) expected_venue = MeetupVenue("Online event", "", "", "", "") assert meetup_event.venue == expected_venue
def paid_meetup_event(paid_meetup_event_json): return MeetupEvent(paid_meetup_event_json)
def free_event_adaptor(free_meetup_event_json): meetup_event = MeetupEvent(free_meetup_event_json) return MeetupToApricotEventAdaptor( meetup_event, EXPECTED_FREE_PHOTO_PATH, EXPECTED_FREE_TAGS )