Skip to content

Commit

Permalink
edit test for media indices
Browse files Browse the repository at this point in the history
  • Loading branch information
hariszaf committed Sep 18, 2023
1 parent a9e3ddf commit 8acfb5f
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tests/fba.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,27 @@ def test_modify_medium(self):

initial_medium = model.medium
initial_fba = model.fba()[-1]

initial_medium_indices = {}
for reac in initial_medium:
initial_medium_indices[reac] = model.reactions.index(reac)

glc_index = model.reactions.index("EX_glc__D_e")

new_media = initial_medium.copy()
new_media["EX_glc__D_e"] = 1.5

model.medium = new_media

if model.lb[glc_index] != -1.5:
self.assertTrue(model.lb[glc_index] == -1.5)
updated_media = model.medium
updated_medium_indices = {}
for reac in updated_media:
updated_medium_indices[reac] = model.reactions.index(reac)

if len(updated_media) == len(new_media):
self.assertTrue(updated_medium_indices == initial_medium_indices)

self.assertTrue(model.lb[glc_index] == -1.5)

self.assertTrue(initial_fba - model.fba()[-1] > 0)

Expand Down

0 comments on commit 8acfb5f

Please sign in to comment.