@@ -545,6 +545,31 @@ def test_handle_repository(self):
545
545
self .assertTrue ("[Warning]" in vc .conversion_log [1 ])
546
546
self .assertEqual (repo .text , invalid )
547
547
548
+ def test_handle_include (self ):
549
+ repo = ET .Element ("include" )
550
+
551
+ # Test working and valid repository link
552
+ repo .text = '/' .join ([REPOSITORY_BASE , 'v1.1' , 'analysis' , 'analysis.xml' ])
553
+ vc = self .VC ("" )
554
+ self .assertIsNone (vc ._handle_include (repo ))
555
+ self .assertEqual (vc .conversion_log , [])
556
+
557
+ # Test replaced working repository link
558
+ repo .text = '/' .join ([REPOSITORY_BASE , 'v1.0' , 'analysis' , 'analysis.xml' ])
559
+ self .assertIsNone (vc ._handle_include (repo ))
560
+ self .assertEqual (repo .text , '/' .join ([REPOSITORY_BASE , 'v1.1' ,
561
+ 'analysis' , 'analysis.xml' ]))
562
+ self .assertEqual (len (vc .conversion_log ), 1 )
563
+ self .assertTrue ("[Info]" in vc .conversion_log [0 ])
564
+
565
+ # Test invalid repository link
566
+ invalid = "I am leading nowhere"
567
+ repo .text = invalid
568
+ self .assertIsNone (vc ._handle_include (repo ))
569
+ self .assertEqual (len (vc .conversion_log ), 2 )
570
+ self .assertTrue ("[Warning]" in vc .conversion_log [1 ])
571
+ self .assertEqual (repo .text , invalid )
572
+
548
573
def test_convert_xml_file (self ):
549
574
# Test minimal reading from an xml file.
550
575
basefile = os .path .join (self .basepath , "version_conversion.xml" )
0 commit comments