Example #1
0
 def test_get_difference(self):
     """
     Tests if the difference is returned with edges that have different weights.
     :return:
     """
     conn_object = BiomConnection()
     conn_object.create_tables()
     conn_object.add_biom(testbiom, 'test')
     conn_object = IoConnection()
     conn_object.add_network(network=g1, name='g1', study='test')
     conn_object.add_network(network=g2, name='g2', study='test')
     conn_object = SetConnection()
     difference_set = conn_object.get_difference(networks=["g1", "g2"])
     conn_object.delete_tables()
     self.assertEqual(len(difference_set.edges), 3)
Example #2
0
 def test_aggr_networks(self):
     """
     Tests if network names are aggregated to an edge property
     named 'source'.
     :return:
     """
     conn_object = BiomConnection()
     conn_object.create_tables()
     conn_object.add_biom(testbiom, 'test')
     conn_object = IoConnection()
     conn_object.add_network(network=g1, name='g1', study='test')
     conn_object.add_network(network=g2, name='g2', study='test')
     conn_object = SetConnection()
     difference_set = conn_object.get_difference(networks=["g1", "g2"])
     conn_object.delete_tables()
     self.assertEqual(
         difference_set.edges[('GG_OTU_1', 'GG_OTU_2')]['source'], 'g1')