File: g_json_test.py

package info (click to toggle)
pyglossary 5.0.9-1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,896 kB
  • sloc: python: 46,165; sh: 308; javascript: 100; xml: 42; makefile: 28
file content (40 lines) | stat: -rw-r--r-- 851 bytes parent folder | download
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
35
36
37
38
39
40
import unittest

from glossary_v2_test import TestGlossaryBase


class TestGlossaryJSON(TestGlossaryBase):
	def __init__(self, *args, **kwargs):
		TestGlossaryBase.__init__(self, *args, **kwargs)

		self.dataFileCRC32.update(
			{
				"004-bar.json": "7e4b2663",
				"100-en-de-v4.json": "6a20c6f6",
				"100-en-fa.json": "8d29c1be",
				"100-ja-en.json": "fab2c106",
			},
		)

	def convert_txt_json(self, fname):
		self.convert(
			f"{fname}.txt",
			f"{fname}-2.json",
			compareText=f"{fname}.json",
		)

	def test_convert_txt_json_0(self):
		self.convert_txt_json("004-bar")

	def test_convert_txt_json_1(self):
		self.convert_txt_json("100-en-fa")

	def test_convert_txt_json_2(self):
		self.convert_txt_json("100-en-de-v4")

	def test_convert_txt_json_3(self):
		self.convert_txt_json("100-ja-en")


if __name__ == "__main__":
	unittest.main()