https://github.com/Dans-labs/text-fabric
Raw File
Tip revision: a84982b3a960398eae55ea44bdc11e67b210e980 authored by Dirk Roorda on 13 January 2017, 14:12:55 UTC
New major release 2.3.0
Tip revision: a84982b
tf-test.py
from tf.read import readFeature

testDir = 'tests'

def test_monads():
    result = readFeature('{}/{}.tf'.format('tests', 'monads'))

    if result == None:
        print('There were errors')
    else:
        (isEdge, metaData, data) = result
        label = 'edge' if isEdge else 'node'
        print('{} feature\n{}\nData: {} {}s'.format(
            label,
            '\n'.join('{:<20}: {}'.format(*x) for x in sorted(metaData.items())),
            len(data),
            label,
        ))

test_monads()
back to top