def test_carbon(self): instance = FattyAcid("FAX", 20, 2, 0, LipidFaBondType.ESTER, False, 1) assert 20 == instance.num_carbon elements = instance.get_elements() assert elements[Element.C] == 20 assert elements[Element.H] == 35 assert elements[Element.O] == 1 assert elements[Element.N] == 0
def new_fa(self, node): if self.unspecified_ether: lipid_FA_bond_type = LipidFaBondType.ETHER_UNSPECIFIED self.unspecified_ether = False else: lipid_FA_bond_type = LipidFaBondType.ESTER self.current_fa = FattyAcid("FA%i" % (len(self.fa_list) + 1), 2, 0, 0, lipid_FA_bond_type, False, 0, {})
def new_lcb(self, node): self.lcb = FattyAcid("LCB", 2, 0, 0, LipidFaBondType.ESTER, True, 1, {}) self.current_fa = self.lcb
def new_fa(self, node): self.current_fa = FattyAcid("FA%i" % (len(self.fa_list) + 1), 2, 0, 0, LipidFaBondType.ESTER, False, 0, {})
def test_wrong_hydroxyl(self): instance = FattyAcid("FAX", 2, 0, -1, LipidFaBondType.UNDEFINED, False, 1)
def test_hydroxyl(self): instance = FattyAcid("FAX", 2, 0, 1, LipidFaBondType.UNDEFINED, False, 1) assert 1 == instance.num_hydroxyl
def test_wrong_db(self): instance = FattyAcid("FAX", 1, 0, 0, LipidFaBondType.UNDEFINED, False, 1)
def test_wrong_position(self): instanceZero = FattyAcid("FA1", 20, 2, 0, LipidFaBondType.UNDEFINED, False, -2)
def test_position(self): instance = FattyAcid("FAX", 2, 0, 0, LipidFaBondType.UNDEFINED, False, 1) assert 1 == instance.position
def test_name(self): instance = FattyAcid("FAX", 2, 0, 0, LipidFaBondType.UNDEFINED, False, 0) assert "FAX" == instance.name
def test_wrong_bond_type(self): instanceZero = FattyAcid("FA1", 2, -1, 0, LipidFaBondType.UNDEFINED, False, 0)
def test_instanceOne(self): instanceOne = FattyAcid("FA1", 2, 1, 0, LipidFaBondType.UNDEFINED, False, 0) assert 1 == instanceOne.num_double_bonds
def test_instanceZero(self): instanceZero = FattyAcid("FA1", 2, 0, 0, LipidFaBondType.UNDEFINED, False, 0) assert 0 == instanceZero.num_double_bonds