Esempio n. 1
0
    def setUp(self):
        super().setUp()

        requests.post('{}/reset'.format(config.rc_root))

        p1 = patch('zulip_util.announce_event')
        p2 = patch('zulip_util.send_message')
        self.addCleanup(p1.stop)
        self.addCleanup(p2.stop)
        p1.start()
        p2.start()

        self.rsvp = rsvp.RSVP('rsvp')

        test_events = rc.get_events(created_at_or_after=dateutil.parser.parse(
            "2017-05-19T20:24:50.309192Z"))

        self.test_data1 = test_events[0]
        self.test_data2 = test_events[1]

        self.event, self.event2 = [
            make_event(self.test_data1),
            make_event(self.test_data2)
        ]
        self._events = [self.event, self.event2]
        Session.add_all(self._events)
        Session.commit()

        self.issue_command('rsvp init {}'.format(self.event.url))
Esempio n. 2
0
 def __init__(self, running, zulip_username, zulip_api_key, key_word, subscribed_streams=None, zulip_site=None):
     self.running = running
     self.key_word = key_word.lower()
     self.subscribed_streams = subscribed_streams or []
     self.client = zulip.Client(zulip_username, zulip_api_key, site=zulip_site)
     self.subscriptions = self.subscribe_to_streams()
     self.rsvp = rsvp.RSVP(key_word)
 def test_dict(self):
     doc = rsvp.RSVP("test name", "*****@*****.**", "1")
     with rsvp.app.test_request_context():
         assert doc.dict() == {
             "_id": "1",
             "name": "test name",
             "email": "*****@*****.**",
             "links": {
                 "self": "http://localhost/api/rsvps/1"
             }
         }
Esempio n. 4
0
 def __init__(self,
              zulip_username,
              zulip_api_key,
              key_word,
              subscribed_streams=None,
              zulip_site=None):
     self.key_word = key_word.lower()
     self.subscribed_streams = subscribed_streams or []
     self.client = zulip.Client(zulip_username,
                                zulip_api_key,
                                site=zulip_site)
     self.client._register('get_users', method='GET', url='users')
     self.subscriptions = self.subscribe_to_streams()
     self.rsvp = rsvp.RSVP(key_word)
Esempio n. 5
0
 def __init__(self,
              zulip_username,
              zulip_api_key,
              key_word,
              subscribed_streams=[],
              zulip_site=None):
     self.username = zulip_username
     self.api_key = zulip_api_key
     self.site = zulip_site
     self.key_word = key_word.lower()
     self.subscribed_streams = subscribed_streams
     self.client = zulip.Client(zulip_username,
                                zulip_api_key,
                                site=zulip_site)
     self.subscriptions = self.subscribe_to_streams()
     self.rsvp = rsvp.RSVP()
Esempio n. 6
0
def testRSVP():
    return rsvp.RSVP(filename='test.json')
Esempio n. 7
0
 def setUp(self):
     self.rsvp = rsvp.RSVP(filename='test.json')
     self.issue_command('rsvp init')
     self.event = self.get_test_event()