Source

psilib / test_som.py

Lynn Rees e483236 







Lynn Rees 687051c 



Lynn Rees e483236 












































Lynn Rees 687051c 
'''Library for PSI maps'''

__title__ = 'test_som'
__version__ = '0.03-test'
__author__  = 'L. C. Rees (xanimal@users.sf.net)'

'''Tests SOM functionality in a structured way'''

from som import *

def testSom():
    '''Test if all of SOM is functioning properly'''
    test = Collection('test', 'test', 'test')
    test.addFilter('test', 'test', 'test')
    test.filters[0].addAction('read', 'test', 'test')
    test.filters[0].addAccess('grant', 'test', 'test')
    test.filters[0].addSort('par', 'test')
    test.filters[0].acl[0].addRight('read')
    test.filters[0].actions[0].addIf('test', 'test')
    test.filters[0].actions[0].setTime('day','5', '10', '11', '5')
    test.filters[0].addVersion('archive', 'seq')
    test.filters[0].setTime('week')
    test.filters[0].versions[0].addChange('name', 'test')
    test.addCollection('test2', 'thing', 'stuff')
    test.addField('thing')
    test.addResource('thing', 'thing', 'thing')
    test.addFilter('thing', 'thing')
    test.addCollection('thing3')
    test.addLink('test')
    test.addInclude('thing')
    test.addResource('test')
    test.resources[0].addResult('test')
    test.resources[0].setMetadata('planned')
    test.resources[0].metadata.addLog('read', 'planned', '10', '20', 'dude', 'test')
    test.resources[0].addFragment('test')
    test.resources[0].addText('some', 'some', 'some', 'preserve', 'some')
    test.resources[0].addException('test')
    test.resources[0].addParameter('test')
    test.resources[0].addResult('test2')
    test.resources[0].addFilter('test')
    test.resources[0].filters[0].addAccess('grant', 'ssl', 'dude')
    test.resources[0].filters[0].acl[0].addRight('read')
    test.resources[0].addLink('something')
    test.resources[0].addParameter('test2')
    test.resources[0].addField('test')
    test.resources[0].addFragment('test2')
    test.resources[0].addField('something')
    test.resources[0].addException('thing', 'thing', 'thing')
    test.resources[0].addInclude('test')
    test.resources[0].addResult('test3')
    test.setMetadata()
    test.addCollection('test3')
    document = Root()
    psi = Psi()
    psi.appendChild(test)
    document.appendChild(psi)
    print document       

if __name__ == '__main__': testSom()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.