Ejemplo n.º 1
0
 def test_url_builder(self):
     b = URLBuilder([('dummy', DummyHandler)])
     self.assertEquals(len(b.get_patterns()), 2)
Ejemplo n.º 2
0
from rest.handler import URLBuilder
from rest.samplehandlers import \
    DummyHandler, DummyTypeHandler, DummyStuffHandler, SecurityTestHandler
from piston.authentication import HttpBasicAuthentication
from authentication import DjangoAuthentication


auth = [DjangoAuthentication(), HttpBasicAuthentication()]

builder = URLBuilder([('dummy', DummyHandler),
                      ('dummyType', DummyTypeHandler),
                      ('dummy_stuff', DummyStuffHandler),
                      ('security_test', SecurityTestHandler)], 'json', auth)
urlpatterns = builder.get_patterns()