File: util_test.py

package info (click to toggle)
python-wn 0.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,184 kB
  • sloc: python: 7,592; xml: 493; sql: 220; makefile: 12
file content (10 lines) | stat: -rw-r--r-- 361 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10

from wn import util


def test_synset_id_formatter():
    f = util.synset_id_formatter
    assert f()(prefix='xyz', offset=123, pos='n') == 'xyz-00000123-n'
    assert f(prefix='xyz')(offset=123, pos='n') == 'xyz-00000123-n'
    assert f(prefix='xyz', pos='n')(offset=123) == 'xyz-00000123-n'
    assert f('abc-{offset}-{pos}')(offset=1, pos='v') == 'abc-1-v'