Exemple #1
0
def test_quotationMarks():
    ffName = "test"
    from Bio import Alphabet
    alphabet = Alphabet.RNAAlphabet()
    alphabet.size = 1
    alphabet.letters = ['A']

    testDB = generate(ffName, [alphabet], True, topPath=testFilePath)

    write_topology_database(testDB, 'test', [alphabet], outDir=testFilePath)

    result = read_topology_database('test', inDir=testFilePath)

    os.remove(testFilePath + 'test.xml')
    print(result['A']['vertices'])
    print(result['A']['bondEdges'])

    assert result['A']['vertices'] == [('A', 'A'), ("A1'", 'A'), ("A2'", 'A'),
                                       ("A1'1", 'A')]

    assert result['A']['bondEdges'][('A', "A1'")] == approx(1.2)
    assert result['A']['bondEdges'][("A1'", "A2'")] == approx(1.0)
    assert result['A']['bondEdges'][("A1'1", "A2'")] == approx(1.1)

    return