Ejemplo n.º 1
0
def test_charge():
    """NeutralValidation should identify net overall charge."""
    assert validate_smiles('O=C([O-])c1ccccc1') == [
        'INFO: [NeutralValidation] Not an overall neutral system (-1)'
    ]
    assert validate_smiles('CN=[NH+]CN=N') == [
        'INFO: [NeutralValidation] Not an overall neutral system (+1)'
    ]
Ejemplo n.º 2
0
def test_isotope():
    """IsotopeValidation should identify atoms with isotope labels."""
    assert validate_smiles('[13CH4]') == [
        'INFO: [IsotopeValidation] Molecule contains isotope 13C'
    ]
    assert validate_smiles('[2H]C(Cl)(Cl)Cl') == [
        'INFO: [IsotopeValidation] Molecule contains isotope 2H'
    ]
    assert validate_smiles('[2H]OC([2H])([2H])[2H]') == [
        'INFO: [IsotopeValidation] Molecule contains isotope 2H'
    ]
Ejemplo n.º 3
0
def test_isotope():
    """IsotopeValidation should identify atoms with isotope labels."""
    assert validate_smiles('[13CH4]') == ['INFO: [IsotopeValidation] Molecule contains isotope 13C']
    assert validate_smiles('[2H]C(Cl)(Cl)Cl') == ['INFO: [IsotopeValidation] Molecule contains isotope 2H']
    assert validate_smiles('[2H]OC([2H])([2H])[2H]') == ['INFO: [IsotopeValidation] Molecule contains isotope 2H']
Ejemplo n.º 4
0
def test_charge():
    """NeutralValidation should identify net overall charge."""
    assert validate_smiles('O=C([O-])c1ccccc1') == ['INFO: [NeutralValidation] Not an overall neutral system (-1)']
    assert validate_smiles('CN=[NH+]CN=N') == ['INFO: [NeutralValidation] Not an overall neutral system (+1)']
Ejemplo n.º 5
0
def test_fragment2():
    """FragmentValidation should identify 1,2-dimethoxyethane."""
    assert validate_smiles('COCCOC.CCCBr') == ['INFO: [FragmentValidation] 1,2-dimethoxyethane is present']
Ejemplo n.º 6
0
def test_fragment():
    """FragmentValidation should identify 1,2-dichloroethane."""
    assert validate_smiles('ClCCCl.c1ccccc1O') == ['INFO: [FragmentValidation] 1,2-dichloroethane is present']
Ejemplo n.º 7
0
def test_no_atoms():
    """An empty SMILES produces a mol with not atoms."""
    assert validate_smiles('') == [u'ERROR: [NoAtomValidation] No atoms are present']
Ejemplo n.º 8
0
def test_none():
    """IsNoneValidation should log due to SMILES parse error."""
    assert validate_smiles('3478q439g98h') == ['ERROR: [IsNoneValidation] Molecule is None']