File: test_dict_est.py

package info (click to toggle)
tomoe 0.6.0-1.3
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 51,396 kB
  • sloc: xml: 1,387,526; ansic: 11,515; sh: 9,072; ruby: 1,344; python: 762; makefile: 450
file content (34 lines) | stat: -rw-r--r-- 1,059 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# encoding: utf-8
import os
import sys
import shutil
import unittest
import tomoe
import test_dict

class TomoeDictEstTest(test_dict.TomoeDictTest):

    def setUp(self):
        self.dict_name = "est-dict"
        self.dict = tomoe.Dict('Est', name = self.dict_name, database = self.dict_name, editable = True)

        tomoe_char = tomoe.Char(utf8 = '池', n_strokes = 6)
        reading = tomoe.Reading(tomoe.READING_JA_KUN, 'いけ')
        tomoe_char.add_reading(reading)
        reading = tomoe.Reading(tomoe.READING_JA_ON, 'チ')
        tomoe_char.add_reading(reading)
        reading = tomoe.Reading(tomoe.READING_JA_ON, 'タ')
        tomoe_char.add_reading(reading)
        reading = tomoe.Reading(tomoe.READING_UNKNOWN, 'あんのうん')
        tomoe_char.add_reading(reading)

        self.dict.register_char(tomoe_char)
        self.dict.flush()

    def tearDown(self):
        self.dict.flush()
        self.dict = None
        if os.access(self.dict_name, os.F_OK):
            shutil.rmtree(self.dict_name)

# vi:ts=4:nowrap:ai:expandtab