Beispiel #1
0
    def test_events_with_filters(self):
        token = TwilioCapability("AC123", "XXXXX")
        token.allow_event_stream(foobar="hey")
        payload = token.payload()

        event_uri = "scope:stream:subscribe?params=foobar%3Dhey&path=%2F2010-04-01%2FEvents"
        assert_equal(payload["scope"], event_uri)
Beispiel #2
0
    def test_outbound_permissions_params(self):
        token = TwilioCapability("AC123", "XXXXX")
        token.allow_client_outgoing("AP123", foobar=3)
        payload = token.payload()

        eurl = "scope:client:outgoing?appParams=foobar%3D3&appSid=AP123"
        assert_equal(payload["scope"], eurl)
Beispiel #3
0
    def test_events(self):
        token = TwilioCapability("AC123", "XXXXX")
        token.allow_event_stream()
        payload = token.payload()

        event_uri = "scope:stream:subscribe?path=%2F2010-04-01%2FEvents"
        assert_equal(payload["scope"], event_uri)
Beispiel #4
0
    def test_events_with_filters(self):
        token = TwilioCapability("AC123", "XXXXX")
        token.allow_event_stream(foobar="hey")
        payload = token.payload()

        event_uri = "scope:stream:subscribe?params=foobar%3Dhey&path=%2F2010-04-01%2FEvents"
        assert_equal(payload["scope"], event_uri)
Beispiel #5
0
    def test_events(self):
        token = TwilioCapability("AC123", "XXXXX")
        token.allow_event_stream()
        payload = token.payload()

        event_uri = "scope:stream:subscribe?path=%2F2010-04-01%2FEvents"
        assert_equal(payload["scope"], event_uri)
Beispiel #6
0
    def test_outbound_permissions_params(self):
        token = TwilioCapability("AC123", "XXXXX")
        token.allow_client_outgoing("AP123", foobar=3)
        payload = token.payload()

        eurl = "scope:client:outgoing?appParams=foobar%3D3&appSid=AP123"
        assert_equal(payload["scope"], eurl)
Beispiel #7
0
    def test_inbound_permissions(self):
        token = TwilioCapability("AC123", "XXXXX")
        token.allow_client_incoming("andy")
        payload = token.payload()

        eurl = "scope:client:incoming?clientName=andy"
        assert_equal(len(payload), 1)
        assert_equal(payload['scope'], eurl)
Beispiel #8
0
    def test_inbound_permissions(self):
        token = TwilioCapability("AC123", "XXXXX")
        token.allow_client_incoming("andy")
        payload = token.payload()

        eurl = "scope:client:incoming?clientName=andy"
        assert_equal(len(payload), 1)
        assert_equal(payload['scope'], eurl)
Beispiel #9
0
    def test_outbound_permissions(self):
        token = TwilioCapability("AC123", "XXXXX")
        token.allow_client_outgoing("AP123")
        payload = token.payload()

        eurl = "scope:client:outgoing?appSid=AP123"

        assert_equal(len(payload), 1)
        self.assertIn(eurl, payload['scope'])
Beispiel #10
0
    def test_outbound_permissions(self):
        token = TwilioCapability("AC123", "XXXXX")
        token.allow_client_outgoing("AP123")
        payload = token.payload()

        eurl = "scope:client:outgoing?appSid=AP123"

        assert_equal(len(payload), 1)
        self.assertIn(eurl, payload['scope'])
Beispiel #11
0
 def test_no_permissions(self):
     token = TwilioCapability("AC123", "XXXXX")
     payload = token.payload()
     assert_equal(len(payload), 1)
     assert_equal(payload["scope"], '')
Beispiel #12
0
 def test_no_permissions(self):
     token = TwilioCapability("AC123", "XXXXX")
     payload = token.payload()
     assert_equal(len(payload), 1)
     assert_equal(payload["scope"], '')