Merge branch 'master' of ssh://git.onelab.eu/git/sfa
[sfa.git] / tests / testXrn.py
index 58aa763..c1cfc6e 100755 (executable)
@@ -69,7 +69,19 @@ class TestXrn(unittest.TestCase):
     def test_hrn010(self):
         self.__hrn("plc.vini.site", 'authority',
                    "urn:publicid:IDN+plc:vini:site+authority+sa" )
-        
+
+    # this one is a bit off limits but it's used in some places
+    # like .e.g when running sfi.py resources
+    def test_void(self):
+        void=Xrn(xrn='',type=None)
+        expected='urn:publicid:IDN++'
+        self.assertEqual(void.get_hrn(),'')
+        self.assertEqual(void.get_type(),None)
+        self.assertEqual(void.get_urn(),expected)
+        loop=Xrn(urn=expected)
+        self.assertEqual(loop.get_hrn(),'')
+        # xxx - this is not quite right as the first object has type None
+        self.assertEqual(loop.get_type(),'')        
 
     
     def test_host001 (self):