def testniceName_1foafmyprop(self): """simple test of nicename for a known namespace (FOAF), unknown property""" foaf_spec = Vocab(dir=FOAFSNAPSHOTDIR, f=FOAFSNAPSHOT) u = 'http://xmlns.com/foaf/0.1/myprop' nn = foaf_spec.niceName(u) # print "nicename for ",u," is: ",nn self.failUnless(nn == 'foaf:myprop', "Didn't extract nicename. input is"+u+"output was"+nn)
def testniceName_2foafhomepage(self): """simple test of nicename for a known namespace (FOAF), known property.""" foaf_spec = Vocab(FOAFSNAPSHOTDIR, FOAFSNAPSHOT) foaf_spec.index() u = 'http://xmlns.com/foaf/0.1/homepage' nn = foaf_spec.niceName(u) # print "nicename for ",u," is: ",nn self.failUnless(nn == 'foaf:homepage', "Didn't extract nicename")
def testniceName_3baduri(self): """niceName should return same string if passed a non-URI (but log a warning?)""" foaf_spec = Vocab(FOAFSNAPSHOTDIR,FOAFSNAPSHOT) foaf_spec.index() u = 'thisisnotauri' nn = foaf_spec.niceName(u) # print "nicename for ",u," is: ",nn self.failUnless(nn == u, "niceName didn't return same string when given a non-URI")
def testniceName_3mystery(self): """simple test of nicename for an unknown namespace""" foaf_spec = Vocab(FOAFSNAPSHOTDIR,FOAFSNAPSHOT) foaf_spec.index() u = 'http:/example.com/mysteryns/myprop' nn = foaf_spec.niceName(u) # print "nicename for ",u," is: ",nn self.failUnless(nn == 'http:/example.com/mysteryns/:myprop', "Didn't extract verbose nicename")
def testniceName_2foafhomepage(self): """simple test of nicename for a known namespace (FOAF), known property.""" foaf_spec = Vocab(FOAFSNAPSHOTDIR,FOAFSNAPSHOT) foaf_spec.index() u = 'http://xmlns.com/foaf/0.1/homepage' nn = foaf_spec.niceName(u) # print "nicename for ",u," is: ",nn self.failUnless(nn == 'foaf:homepage', "Didn't extract nicename")
def testniceName_3baduri(self): """niceName should return same string if passed a non-URI (but log a warning?)""" foaf_spec = Vocab(FOAFSNAPSHOTDIR, FOAFSNAPSHOT) foaf_spec.index() u = 'thisisnotauri' nn = foaf_spec.niceName(u) # print "nicename for ",u," is: ",nn self.failUnless( nn == u, "niceName didn't return same string when given a non-URI")
def testniceName_3mystery(self): """simple test of nicename for an unknown namespace""" foaf_spec = Vocab(FOAFSNAPSHOTDIR, FOAFSNAPSHOT) foaf_spec.index() u = 'http:/example.com/mysteryns/myprop' nn = foaf_spec.niceName(u) # print "nicename for ",u," is: ",nn self.failUnless(nn == 'http:/example.com/mysteryns/:myprop', "Didn't extract verbose nicename")
def testniceName_1foafmyprop(self): """simple test of nicename for a known namespace (FOAF), unknown property""" foaf_spec = Vocab(dir=FOAFSNAPSHOTDIR, f=FOAFSNAPSHOT) u = 'http://xmlns.com/foaf/0.1/myprop' nn = foaf_spec.niceName(u) # print "nicename for ",u," is: ",nn self.failUnless( nn == 'foaf:myprop', "Didn't extract nicename. input is" + u + "output was" + nn)