/usr/share/pyshared/Epigrass/testinst.py is in epigrass 2.0.4-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | """
Unit testing script
"""
import unittest
from manager import *
class testObjInstantiation(unittest.TestCase):
def setUp(self):
self.sitios = loadData('/home/fccoelho/Documents/Projects_software/epigrass/epigrass/simobj/sitios3.csv',sep=',')
self.ed=loadData('/home/fccoelho/Documents/Projects_software/epigrass/epigrass/simobj/edgesout.csv',sep=',')
self.S=simulate()
def testSites(self):
l = self.S.instSites(self.sitios)
for i in range(len(l)):
self.assertEqual(l[i].sitename,self.sitios[i][2])
def testEdges(self):
l = self.S.instSites(self.sitios)
e = self.S.instEdges(l,self.ed)
j = 0
for i in e:
self.assertEqual((i.source.sitename, i.dest.sitename),(self.ed[j][0],self.ed[j][1]))
j+=1
def testGraph(self):
l = self.S.instSites(self.sitios)
e = self.S.instEdges(l,self.ed)
g = self.S.instGraph('grafo',1,l,e)
print g, g.getSiteNames()
if __name__ == '__main__':
unittest.main()
|