Beispiel #1
0
 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)
Beispiel #2
0
 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")
Beispiel #3
0
 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")
Beispiel #4
0
 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")
Beispiel #5
0
 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")
Beispiel #6
0
 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")
Beispiel #7
0
 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")
Beispiel #8
0
 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)