MCPcopy Create free account
hub / github.com/easy-graph/Easy-Graph / setup_class

Method setup_class

easygraph/readwrite/tests/test_gexf.py:11–133  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

9class TestGEXF:
10 @classmethod
11 def setup_class(cls):
12 cls.simple_directed_data = """<?xml version="1.0" encoding="UTF-8"?>
13<gexf xmlns="http://www.gexf.net/1.2draft" version="1.2">
14 <graph mode="static" defaultedgetype="directed">
15 <nodes>
16 <node id="0" label="Hello" />
17 <node id="1" label="Word" />
18 </nodes>
19 <edges>
20 <edge id="0" source="0" target="1" />
21 </edges>
22 </graph>
23</gexf>
24"""
25 cls.simple_directed_graph = eg.DiGraph()
26 cls.simple_directed_graph.add_node("0", label="Hello")
27 cls.simple_directed_graph.add_node("1", label="World")
28 cls.simple_directed_graph.add_edge("0", "1", id="0")
29
30 cls.simple_directed_fh = io.BytesIO(cls.simple_directed_data.encode("UTF-8"))
31
32 cls.attribute_data = """<?xml version="1.0" encoding="UTF-8"?>\
33<gexf xmlns="http://www.gexf.net/1.2draft" xmlns:xsi="http://www.w3.\
34org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.gexf.net/\
351.2draft http://www.gexf.net/1.2draft/gexf.xsd" version="1.2">
36 <meta lastmodifieddate="2009-03-20">
37 <creator>Gephi.org</creator>
38 <description>A Web network</description>
39 </meta>
40 <graph defaultedgetype="directed">
41 <attributes class="node">
42 <attribute id="0" title="url" type="string"/>
43 <attribute id="1" title="indegree" type="integer"/>
44 <attribute id="2" title="frog" type="boolean">
45 <default>true</default>
46 </attribute>
47 </attributes>
48 <nodes>
49 <node id="0" label="Gephi">
50 <attvalues>
51 <attvalue for="0" value="https://gephi.org"/>
52 <attvalue for="1" value="1"/>
53 <attvalue for="2" value="false"/>
54 </attvalues>
55 </node>
56 <node id="1" label="Webatlas">
57 <attvalues>
58 <attvalue for="0" value="http://webatlas.fr"/>
59 <attvalue for="1" value="2"/>
60 <attvalue for="2" value="false"/>
61 </attvalues>
62 </node>
63 <node id="2" label="RTGI">
64 <attvalues>
65 <attvalue for="0" value="http://rtgi.fr"/>
66 <attvalue for="1" value="1"/>
67 <attvalue for="2" value="true"/>
68 </attvalues>

Callers

nothing calls this directly

Calls 4

DiGraphMethod · 0.80
GraphMethod · 0.80
add_nodeMethod · 0.45
add_edgeMethod · 0.45

Tested by

no test coverage detected