예제 #1
0
파일: tests.py 프로젝트: leocarv/Roadmap
 def test_url_builder(self):
     b = URLBuilder([('dummy', DummyHandler)])
     self.assertEquals(len(b.get_patterns()), 2)
예제 #2
0
파일: urls.py 프로젝트: leocarv/Roadmap
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()