len(mol.chains[0].secondarystructureset)==11


def test_simplefile():
    from MolKit import Read
    mol = Read("./Data/1crn.pdb")[0]
    mol.secondaryStructureFromFile()
    assert hasattr(mol.chains[0], 'secondarystructureset') and \
           len(mol.chains[0].secondarystructureset)==10


def test_getsecondarystructureChain():
    if haveStride:
        from MolKit import Read
        mol = Read("./Data/fxnohtatm.pdb")[0]
        from MolKit.getsecondarystructure import GetSecondaryStructureFromStride
        ssb = GetSecondaryStructureFromStride(mol)
        mol.secondaryStructure(ssb)


harness = testplus.TestHarness(
    __name__,
    #funs = testplus.testcollect( globals()),
    funs=[
        test_getsecondarystructureChain,
    ])

if __name__ == '__main__':
    print harness
    sys.exit(len(harness))
Esempio n. 2
0
    assert len(forms[2].select.keys()) == 2
    assert len(forms[2].input.keys()) == 2
    # testing comboboxes:
    assert len(forms[2].select['what-to-do']['options']) == 5
    assert forms[2].select['what-to-do']['options'][0] == 'Drink Coffee'

    assert len(forms[2].select['who-to-do-it-with']['options']) == 6
    assert forms[2].select['who-to-do-it-with']['options'][-1] == 'Chouck'

    ##########################################################################
    # FORM 3
    # form[3] has 3 textareas (TEXTAREA) and 2 buttons (INPUT)

    print forms[3].textarea
    assert len(forms[3].textarea.items()) == 3
    assert len(forms[3].input) == 2
    # testing textareas:
    assert forms[3].textarea['positive']['cols'] == '60'
    assert forms[3].textarea['positive']['rows'] == '20'
    assert forms[3].textarea['username']['text'][0] == 'Your Name Here'


harness = testplus.TestHarness(
    __name__,
    funs=testplus.testcollect(globals()),
)

if __name__ == '__main__':
    print harness
    sys.exit(len(harness))
    print mol.chains.name

    # Protein with No TER records at all and 2 chains
    print "Testing 1crn2Chains.pdb: protein with only 1 TER record at the end of the ATOM"
    mol = Read("Data/1crn2ChainsNOTER.pdb")[0]
    assert len(mol.chains) == 2, "Expecting 1 chain got %s" % len(mol.chains)
    assert mol.chains.name == [
        'A', 'B'
    ], "Expecting chain name ' ', got %s" % mol.chains.name
    print mol.chains.name


def test_parsePQR():
    from MolKit.pdbParser import PQRParser
    parser = PQRParser("./Data/mead.pqr")
    mols = parser.parse()
    assert len(mols) == 1, "Expecting 1 molecule mead got %s" % mols.name
    mol = mols[0]
    assert len(mol.chains) == 1, "Expecting 1 chain got %s" % len(mol.chains)


harness = testplus.TestHarness(
    __name__,
    funs=testplus.testcollect(globals()),
    #funs=[test_parsegetRecords],
)

if __name__ == '__main__':
    print harness
    sys.exit(len(harness))
                          'orient':'horizontal',
                          'buttontype':'radiobutton'},
                  'gridcfg':{'sticky':'w'} })

    descr.append({'name':'radioselect',
                  'widgetType':Pmw.RadioSelect,
                  'parent':'Page3',
                  'defaultValue':'rb5',
                  'listtext':['rb1', 'rb2', 'rb3','rb4', 'rb5', 'rb6',
                              'rb7', 'rb8', 'rb9','rb10', 'rb11', 'rb12'],
                  'wcfg':{'labelpos':'n',
                          'label_text':'Radiobuttons: ',
                          'orient':'vertical',
                          'buttontype':'radiobutton'},
                  'gridcfg':{'sticky':'w'} })
    form = InputForm(master, root, descr, modal=0, blocking=0)
    values = form.testForm(container='Page3')
    assert values['radioselect']=='rb5'
    form.destroy() 
    
harness = testplus.TestHarness( __name__,
                                connect = setUp,
                                funs = testplus.testcollect( globals()),
                                #funs = [test_inputform_4,] ,
                                disconnect = tearDown
                                )

if __name__ == '__main__':
    print harness
    sys.exit( len( harness))
Esempio n. 5
0
    print(m.sesr.fst.n_buried_sas_area)

    vfloat, vint, tri = m.getBuriedSurfaceTriangles(selnum=1)
    print(
        "getBuriedSurfaceTriangles(selnum=1): len(vfloat): %d, len(vint): %d, len(tri): %d"
        % (len(vfloat), len(vint), len(tri)))
    vfloat, vint, tri = m.getBuriedSurfaceTriangles(selnum=2)
    print(
        "getBuriedSurfaceTriangles(selnum=2): len(vfloat): %d, len(vint): %d, len(tri): %d"
        % (len(vfloat), len(vint), len(tri)))
    vfloat, vint, tri = m.getBuriedSurfaceTriangles(selnum=3)
    print(
        "getBuriedSurfaceTriangles(selnum=3): len(vfloat): %d, len(vint): %d, len(tri): %d"
        % (len(vfloat), len(vint), len(tri)))


##  harness = testplus.TestHarness( __name__,
##                                  connect = importLib,
##                                  funs = testplus.testcollect( globals()),
##                                  )

if __name__ == '__main__':
    testplus.chdir()
    args = ()
    harness = testplus.TestHarness(__name__,
                                   connect=(setUpSuite, args, {}),
                                   funs=testplus.testcollect(globals()),
                                   disconnect=tearDownSuite)
    print(harness)
    sys.exit(len(harness))
Esempio n. 6
0
import sys
from mglutil.regression import testplus
import test_htmlparser

harness = testplus.TestHarness(
    __name__,
    funs=[],
    dependents=[
        test_htmlparser.harness,
    ],
)

if __name__ == '__main__':
    print harness
    sys.exit(len(harness))
Esempio n. 7
0
    assert rings.ringCount == 6


def test_findCycles2():
    # test cycle detection on modified taxol to have 5 membered ring
    atoms, bonds = getGraphFromFile('Data/fuzedRings2.graph')
    from PyBabel.cycle import RingFinder
    rings = RingFinder()
    rings.findRings2(atoms, bonds)
    assert rings.ringCount == 4


def test_findCycles3():
    # test cycle detection on taxol merged rings only
    atoms, bonds = getGraphFromFile('Data/fuzedRings1.graph')
    from PyBabel.cycle import RingFinder
    rings = RingFinder()
    rings.findRings2(atoms, bonds)
    assert rings.ringCount == 4


harness = testplus.TestHarness(
    "PyBabel_cycles",
    funs=testplus.testcollect(globals()),
)

if __name__ == '__main__':
    testplus.chdir()
    print harness
    sys.exit(len(harness))