Ejemplo n.º 1
0
def createGraphs():
    _locks = dict()
    for _file in testComGraphvizWriters.output.keys():
        print "File: %s" % _file
        _parser = GLockParser(open(_file))
        _writer = GraphvizGLockWriter()
        _name = _writer.NAME
        print "Writer: %s" % _name
        _writer.out = "%s.svg" % _file
        _writer.writeBegin()
        _locks = _parser.items()
        for _lock in _locks:
            _writer.write(_lock)
        _writer.writeEnd()
def createGraphs():
    _locks = dict()
    for _file in testComGraphvizWriters.output.keys():
        print "File: %s" % _file
        _parser = GLockParser(open(_file))
        _writer = GraphvizGLockWriter()
        _name = _writer.NAME
        print "Writer: %s" % _name
        _writer.out = "%s.svg" % _file
        _writer.writeBegin()
        _locks = _parser.items()
        for _lock in _locks:
            _writer.write(_lock)
        _writer.writeEnd()
Ejemplo n.º 3
0
 def testGraphvizGLockWriter(self):
     import StringIO
     _locks = dict()
     for _file in self.output.keys():
         print "File: %s" % _file
         _parser = GLockParser(open(_file))
         _locks[_file] = _parser.items()
     _writer = GraphvizGLockWriter()
     _name = _writer.NAME
     print "Writer: %s" % _name
     for _file, _locklist in _locks.items():
         _buf = StringIO.StringIO()
         _writer.out = _buf
         _writer.writeBegin()
         for _lock in _locklist:
             _writer.write(_lock)
         _writer.writeEnd()
         print _buf.getvalue()
         self.assertEquals(
             self.output[_file][_name].replace("\t", "    "),
             _buf.getvalue().replace("\t", "    "),
             "Could not match output for file %s and writer %s" %
             (_file, _name))
        def testGraphvizGLockWriter(self):
            import StringIO

            _locks = dict()
            for _file in self.output.keys():
                print "File: %s" % _file
                _parser = GLockParser(open(_file))
                _locks[_file] = _parser.items()
            _writer = GraphvizGLockWriter()
            _name = _writer.NAME
            print "Writer: %s" % _name
            for _file, _locklist in _locks.items():
                _buf = StringIO.StringIO()
                _writer.out = _buf
                _writer.writeBegin()
                for _lock in _locklist:
                    _writer.write(_lock)
                _writer.writeEnd()
                print _buf.getvalue()
                self.assertEquals(
                    self.output[_file][_name].replace("\t", "    "),
                    _buf.getvalue().replace("\t", "    "),
                    "Could not match output for file %s and writer %s" % (_file, _name),
                )