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"))
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"))
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"))
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"))