Пример #1
0
    def testOrderOnlyDependency( self ):
        artifact1 = AtomicArtifact( "TestArtefact1", [ os.path.join( "tmp", "file1" ), os.path.join( "tmp", "file2" ) ], [], [], [], False )
        compound = CompoundArtifact( "TestArtefact3", [ artifact1 ], False )
        artifact2 = AtomicArtifact( "TestArtefact2", [ os.path.join( "tmp", "file3" ), os.path.join( "tmp", "file4" ) ], [], [ artifact1 ], [], False )
        
        g1 = Graph( "project" )
        cluster1 = Cluster( "TestArtefact1" )
        cluster1.add( Node( os.path.join( "tmp", "file1" ) ) )
        cluster1.add( Node( os.path.join( "tmp", "file2" ) ) )
        cluster = Cluster( "TestArtefact3" )
        cluster.add( cluster1 )
        g1.add( cluster )
        cluster2 = Cluster( "TestArtefact2" )
        cluster2.add( Node( os.path.join( "tmp", "file3" ) ) )
        cluster2.add( Node( os.path.join( "tmp", "file4" ) ) )
        g1.add( cluster2 )
        link = Link( cluster2, cluster1 )
        link.attr[ "style" ] = "dashed"
        g1.add( link )
        
        g2 = Graph( "project" )
        g2.add( artifact2.getGraphNode() )
        g2.add( compound.getGraphNode() )
        for l in artifact2.getGraphLinks():
            g2.add( l )
        for l in compound.getGraphLinks():
            g2.add( l )

        self.assertTrue( Graph.areSame( g1, g2 ) )
Пример #2
0
 def testCompound( self ):
     atomic1 = AtomicArtifact( "TestArtefact1", [ os.path.join( "tmp", "file1" ), os.path.join( "tmp", "file2" ) ], [], [], [], False )
     atomic2 = AtomicArtifact( "TestArtefact2", [ os.path.join( "tmp", "file3" ), os.path.join( "tmp", "file4" ) ], [], [], [], False )
     artifact = CompoundArtifact( "TestArtefact3", [ atomic1, atomic2 ], False )
     
     g1 = Graph( "project" )
     mainCluster = Cluster( "TestArtefact3" )
     cluster = Cluster( "TestArtefact1" )
     cluster.add( Node( os.path.join( "tmp", "file1" ) ) )
     cluster.add( Node( os.path.join( "tmp", "file2" ) ) )
     mainCluster.add( cluster )
     cluster = Cluster( "TestArtefact2" )
     cluster.add( Node( os.path.join( "tmp", "file3" ) ) )
     cluster.add( Node( os.path.join( "tmp", "file4" ) ) )
     mainCluster.add( cluster )
     g1.add( mainCluster )
     
     g2 = Graph( "project" )
     g2.add( artifact.getGraphNode() )
     
     self.assertTrue( Graph.areSame( g1, g2 ) )