예제 #1
0
 def test_defaults_with_basic_params(self):
     handler = MockHandler()
     params = ParamDict(handler,
                        context_name='ctx_name',
                        class_name='klass')
     self.assertEquals('ctx_name', params.get("context_name"))
     self.assertEquals('klass', params.get("class_name"))
예제 #2
0
 def test_class_uri_sets_class_prefix_overriding_slug(self):
     handler = MockHandler()
     params = ParamDict(handler,
                        context_name="glb",
                        class_uri="base:Conteudo")
     self.assertEquals(u'http://semantica.globo.com/base/',
                       params.get("class_prefix"))
예제 #3
0
 def test_override(self):
     handler = MockHandler(
         querystring="context_name=dbpedia&class_name=overriden_class_name")
     params = ParamDict(handler,
                        context_name='dbpedia',
                        class_name="default_class_name",
                        class_prefix=None)
     self.assertEquals("overriden_class_name", params.get("class_name"))
 def test_root_context(self):
     handler = MockHandler()
     params = ParamDict(handler, context_name=ROOT_CONTEXT)
     self.assertEquals(URI_PREFIX, params.get("graph_uri"))
 def test_defaults_without_basic_params(self):
     handler = MockHandler()
     params = ParamDict(handler)
     self.assertEquals(None, params.get("context_name"))
     self.assertEquals(None, params.get("class_name"))
     self.assertEquals(None, params.get("instance_id"))
 def test_class_uri(self):
     handler = MockHandler()
     params = ParamDict(handler, class_uri="dbpedia:Python")
     self.assertEquals("http://dbpedia.org/ontology/Python", params.get("class_uri"))
예제 #7
0
 def test_root_context(self):
     handler = MockHandler()
     params = ParamDict(handler, context_name=ROOT_CONTEXT)
     self.assertEquals(URI_PREFIX, params.get("graph_uri"))
예제 #8
0
 def test_override(self):
     handler = MockHandler(querystring="context_name=dbpedia&class_name=overriden_class_name")
     params = ParamDict(handler, context_name='dbpedia', class_name="default_class_name", class_prefix=None)
     self.assertEquals("overriden_class_name", params.get("class_name"))
예제 #9
0
 def test_defaults_with_basic_params(self):
     handler = MockHandler()
     params = ParamDict(handler, context_name='ctx_name', class_name='klass')
     self.assertEquals('ctx_name', params.get("context_name"))
     self.assertEquals('klass', params.get("class_name"))
예제 #10
0
 def test_defaults_without_basic_params(self):
     handler = MockHandler()
     params = ParamDict(handler)
     self.assertEquals(None, params.get("context_name"))
     self.assertEquals(None, params.get("class_name"))
     self.assertEquals(None, params.get("instance_id"))
예제 #11
0
 def test_class_uri_sets_class_prefix_overriding_slug(self):
     handler = MockHandler()
     params = ParamDict(handler, context_name="glb", class_uri="base:Conteudo")
     self.assertEquals(u'http://semantica.globo.com/base/', params.get("class_prefix"))
예제 #12
0
 def test_class_uri(self):
     handler = MockHandler()
     params = ParamDict(handler, class_uri="dbpedia:Python")
     self.assertEquals("http://dbpedia.org/ontology/Python", params.get("class_uri"))