Skip to content

Commit

Permalink
fix: flake8 is a cruel mistress
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianLieven authored and Midnighter committed Sep 6, 2018
1 parent 17eb5c6 commit 3e465c1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
25 changes: 12 additions & 13 deletions cobra/test/test_compartment.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,30 @@
from __future__ import absolute_import

import pytest
from cobra.core import Metabolite, Model, Reaction, Compartment

from cobra.core import Compartment

def test__eq__():
a = b = Compartment("x")
c = "x"
d = Compartment("x")
e = Compartment ("z")
assert a.__eq__(b) == True
assert a.__eq__(c) == True
assert a.__eq__(d) == True
assert a.__eq__(e) == False
e = Compartment("z")
assert a.__eq__(b) is True
assert a.__eq__(c) is True
assert a.__eq__(d) is True
assert a.__eq__(e) is False


def test__ne__():
a = b = Compartment("x")
c = "x"
d = Compartment("x")
e = Compartment ("z")
assert a.__ne__(b) == False
assert a.__ne__(c) == False
assert a.__ne__(d) == False
assert a.__ne__(e) == True
e = Compartment("z")
assert a.__ne__(b) is False
assert a.__ne__(c) is False
assert a.__ne__(d) is False
assert a.__ne__(e) is True


def test_error_with_non_sane_id():
with pytest.raises(TypeError):
Compartment("Trust Me This ID Is Sane")
Compartment("Trust Me This ID Is Sane")
9 changes: 5 additions & 4 deletions cobra/test/test_metabolite.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
from __future__ import absolute_import

import pytest
from cobra.core import Metabolite, Model, Reaction, Compartment
from cobra.core import Metabolite, Model, Compartment


def test_compartment_setter():
met = Metabolite('x', compartment=None)
cytosol = Compartment('c')
model = Model()
model.add_compartments([cytosol])
met2 =Metabolite("y")
met2 = Metabolite("y")
met5 = Metabolite("b")
model.add_metabolites([met2, met5])
met2.compartment = Compartment("c")
Expand All @@ -21,7 +22,7 @@ def test_compartment_setter():
assert met.compartment is None
assert met2.compartment is cytosol
assert met3.compartment is cytosol
assert isinstance(met4.compartment,Compartment)
assert isinstance(met4.compartment, Compartment)
assert met5.compartment is cytosol
with pytest.raises(TypeError):
Metabolite("c", compartment="Sane Compartment, Not!")
Metabolite("c", compartment="Sane Compartment, Not!")

0 comments on commit 3e465c1

Please sign in to comment.