def test_parse_medium(self): medium = list( native.parse_medium( { 'compartment': 'e', 'compounds': [{ 'id': 'ac' }, { 'id': 'glcD', 'lower': -10 }, { 'id': 'co2', 'upper': 50 }, { 'id': 'compound_x', 'compartment': 'c' }, { 'id': 'compound_y', 'reaction': 'EX_cpdy' }] }, 'e')) self.assertEqual(len(medium), 5) self.assertEqual(medium[0], (Compound('ac', 'e'), None, None, None)) self.assertEqual(medium[1], (Compound('glcD', 'e'), None, -10, None)) self.assertEqual(medium[2], (Compound('co2', 'e'), None, None, 50)) self.assertEqual(medium[3], (Compound('compound_x', 'c'), None, None, None)) self.assertEqual(medium[4], (Compound('compound_y', 'e'), 'EX_cpdy', None, None))
def test_parse_medium(self): medium = list(native.parse_medium({ 'compartment': 'e', 'compounds': [ {'id': 'ac'}, {'id': 'glcD', 'lower': -10}, {'id': 'co2', 'upper': 50}, {'id': 'compound_x', 'compartment': 'c'}, {'id': 'compound_y', 'reaction': 'EX_cpdy'} ] })) self.assertEqual(len(medium), 5) self.assertEqual(medium[0], (Compound('ac', 'e'), None, None, None)) self.assertEqual(medium[1], (Compound('glcD', 'e'), None, -10, None)) self.assertEqual(medium[2], (Compound('co2', 'e'), None, None, 50)) self.assertEqual( medium[3], (Compound('compound_x', 'c'), None, None, None)) self.assertEqual( medium[4], (Compound('compound_y', 'e'), 'EX_cpdy', None, None))