https://github.com/Dans-labs/text-fabric
Revision 63b98b581275cd9a78660a934dd2e6ad20004659 authored by Dirk Roorda on 08 December 2016, 18:21:07 UTC, committed by Dirk Roorda on 08 December 2016, 18:21:07 UTC
1 parent cf87b45
Raw File
Tip revision: 63b98b581275cd9a78660a934dd2e6ad20004659 authored by Dirk Roorda on 08 December 2016, 18:21:07 UTC
docs
Tip revision: 63b98b5
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