File: util_test.py

package info (click to toggle)
python-wn 1.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,100 kB
  • sloc: python: 8,429; xml: 566; sql: 238; makefile: 12
file content (9 lines) | stat: -rw-r--r-- 360 bytes parent folder | download
1
2
3
4
5
6
7
8
9
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"