Ejemplo n.º 1
0
    def test_parseFile(self):
        filename = "links.txt"
        Relations = Requirements.relationsParser(filename)

        Relations.parseFile()

        self.assertEqual(Relations.relations , [["hola","adios"],["a","b"]])
Ejemplo n.º 2
0
    def setUp(self):
        filenameNodes = "nodes_1.txt"
        filenameLinks = "links_1.txt"
        Nodes     = Requirements.nodesParser(filenameNodes)  
        Nodes.parseFile()      
        Relations = Requirements.relationsParser(filenameLinks)
        Relations.parseFile()

        self.container = Requirements.nodesContainer()
        Nodes.loadNodeContainer(self.container)
        Relations.loadNodeContainer(self.container)
Ejemplo n.º 3
0
    def test_loadCOnatiner(self):
        filename = "links.txt"
        Relations = Requirements.relationsParser(filename)
        Relations.parseFile()    

        container = Requirements.nodesContainer()

        Relations.loadNodeContainer(container)
        Nodes = container.getNodesArray()    

        self.assertEqual(Nodes , ["a","adios","b","hola"])  
Ejemplo n.º 4
0
    def test_parseline(self):
        # make sure the shuffled sequence does not lose any elements
        filename = ""
        Relations = Requirements.relationsParser(filename)

        Relations.parseLine(" hola -> adios      ")

        self.assertEqual(Relations.relations , [["hola","adios"]])

        Relations.parseLine(" hola <- adios ")
        Relations.parseLine("")
        self.assertEqual(Relations.relations , [["hola","adios"]])

        Relations.parseLine(" a->b  ")

        self.assertEqual(Relations.relations , [["hola","adios"],["a","b"]])