def test_build_graph_json(self): """ Test buildGraphJson(self, root, data, flt=list()) """ sf = SpiderFoot(dict()) sf.buildGraphJson(None, None) self.assertEqual('TBD', 'TBD')
def test_build_graph_json_should_return_a_string(self): """ Test buildGraphJson(self, root, data, flt=list()) """ sf = SpiderFoot(dict()) json = sf.buildGraphJson(None, None) self.assertIsInstance(json, str) json = sf.buildGraphJson('', '') self.assertIsInstance(json, str)
def test_build_graph_json_should_return_a_string(self): """ Test buildGraphJson(self, root, data, flt=list()) """ sf = SpiderFoot(dict()) json = sf.buildGraphJson('', '') self.assertEqual(str, type(json))
def scanviz(self, id, gexf="0"): dbh = SpiderFootDb(self.config) sf = SpiderFoot(self.config) data = dbh.scanResultEvent(id, filterFp=True) scan = dbh.scanInstanceGet(id) root = scan[1] if gexf != "0": cherrypy.response.headers['Content-Disposition'] = "attachment; filename=SpiderFoot.gexf" cherrypy.response.headers['Content-Type'] = "application/gexf" cherrypy.response.headers['Pragma'] = "no-cache" return sf.buildGraphGexf([root], "SpiderFoot Export", data) else: return sf.buildGraphJson([root], data)
def scanviz(self, id, gexf="0"): types = list() dbh = SpiderFootDb(self.config) sf = SpiderFoot(self.config) data = dbh.scanResultEvent(id, filterFp=True) scan = dbh.scanInstanceGet(id) root = scan[1] if gexf != "0": cherrypy.response.headers['Content-Disposition'] = "attachment; filename=SpiderFoot.gexf" cherrypy.response.headers['Content-Type'] = "application/gexf" cherrypy.response.headers['Pragma'] = "no-cache" return sf.buildGraphGexf([root], "SpiderFoot Export", data) else: return sf.buildGraphJson([root], data)