diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2015-07-16 07:41:47 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2015-07-16 07:41:47 +0300 |
commit | 8e11d7f20459697c883df1e421df02006f749792 (patch) | |
tree | 9ff24bccbb840535590e2985f45f4205e44244c2 | |
parent | 45b2027439e96c366e188a12bd831802d30bbddc (diff) | |
download | wit-8e11d7f20459697c883df1e421df02006f749792.tar.gz wit-8e11d7f20459697c883df1e421df02006f749792.tar.bz2 |
Fix test.py to work with Python 3
-rw-r--r-- | test.py | 40 |
1 files changed, 21 insertions, 19 deletions
@@ -17,2 +17,3 @@ | |||
17 | 17 | ||
18 | from __future__ import print_function | ||
18 | import unittest | 19 | import unittest |
@@ -23,3 +24,3 @@ class TestMarkupParserBasic (unittest.TestCase): | |||
23 | def test_colon(self): | 24 | def test_colon(self): |
24 | self.assert_(self.__test('colon')) | 25 | self.assertTrue(self.__test('colon')) |
25 | pass | 26 | pass |
@@ -27,3 +28,3 @@ class TestMarkupParserBasic (unittest.TestCase): | |||
27 | def test_headings(self): | 28 | def test_headings(self): |
28 | self.assert_(self.__test('headings')) | 29 | self.assertTrue(self.__test('headings')) |
29 | pass | 30 | pass |
@@ -31,3 +32,3 @@ class TestMarkupParserBasic (unittest.TestCase): | |||
31 | def test_hz(self): | 32 | def test_hz(self): |
32 | self.assert_(self.__test('hz')) | 33 | self.assertTrue(self.__test('hz')) |
33 | pass | 34 | pass |
@@ -35,3 +36,3 @@ class TestMarkupParserBasic (unittest.TestCase): | |||
35 | def test_numlist(self): | 36 | def test_numlist(self): |
36 | self.assert_(self.__test('numlist')) | 37 | self.assertTrue(self.__test('numlist')) |
37 | pass | 38 | pass |
@@ -39,3 +40,3 @@ class TestMarkupParserBasic (unittest.TestCase): | |||
39 | def test_unlist(self): | 40 | def test_unlist(self): |
40 | self.assert_(self.__test('unlist')) | 41 | self.assertTrue(self.__test('unlist')) |
41 | pass | 42 | pass |
@@ -43,3 +44,3 @@ class TestMarkupParserBasic (unittest.TestCase): | |||
43 | def test_deflist(self): | 44 | def test_deflist(self): |
44 | self.assert_(self.__test('deflist')) | 45 | self.assertTrue(self.__test('deflist')) |
45 | pass | 46 | pass |
@@ -47,3 +48,3 @@ class TestMarkupParserBasic (unittest.TestCase): | |||
47 | def test_para(self): | 48 | def test_para(self): |
48 | self.assert_(self.__test('para')) | 49 | self.assertTrue(self.__test('para')) |
49 | pass | 50 | pass |
@@ -51,3 +52,3 @@ class TestMarkupParserBasic (unittest.TestCase): | |||
51 | def test_it(self): | 52 | def test_it(self): |
52 | self.assert_(self.__test('it')) | 53 | self.assertTrue(self.__test('it')) |
53 | pass | 54 | pass |
@@ -55,3 +56,3 @@ class TestMarkupParserBasic (unittest.TestCase): | |||
55 | def test_bold(self): | 56 | def test_bold(self): |
56 | self.assert_(self.__test('bold')) | 57 | self.assertTrue(self.__test('bold')) |
57 | pass | 58 | pass |
@@ -59,3 +60,3 @@ class TestMarkupParserBasic (unittest.TestCase): | |||
59 | def test_boldit1(self): | 60 | def test_boldit1(self): |
60 | self.assert_(self.__test('boldit1')) | 61 | self.assertTrue(self.__test('boldit1')) |
61 | pass | 62 | pass |
@@ -63,3 +64,3 @@ class TestMarkupParserBasic (unittest.TestCase): | |||
63 | def test_itbold1(self): | 64 | def test_itbold1(self): |
64 | self.assert_(self.__test('itbold1')) | 65 | self.assertTrue(self.__test('itbold1')) |
65 | pass | 66 | pass |
@@ -67,3 +68,3 @@ class TestMarkupParserBasic (unittest.TestCase): | |||
67 | def test_boldit2(self): | 68 | def test_boldit2(self): |
68 | self.assert_(self.__test('boldit2')) | 69 | self.assertTrue(self.__test('boldit2')) |
69 | pass | 70 | pass |
@@ -71,3 +72,3 @@ class TestMarkupParserBasic (unittest.TestCase): | |||
71 | def test_itbold2(self): | 72 | def test_itbold2(self): |
72 | self.assert_(self.__test('itbold2')) | 73 | self.assertTrue(self.__test('itbold2')) |
73 | pass | 74 | pass |
@@ -75,3 +76,3 @@ class TestMarkupParserBasic (unittest.TestCase): | |||
75 | def test_boldit3(self): | 76 | def test_boldit3(self): |
76 | self.assert_(self.__test('boldit3')) | 77 | self.assertTrue(self.__test('boldit3')) |
77 | pass | 78 | pass |
@@ -79,3 +80,3 @@ class TestMarkupParserBasic (unittest.TestCase): | |||
79 | def test_itbold3(self): | 80 | def test_itbold3(self): |
80 | self.assert_(self.__test('itbold3')) | 81 | self.assertTrue(self.__test('itbold3')) |
81 | pass | 82 | pass |
@@ -83,3 +84,3 @@ class TestMarkupParserBasic (unittest.TestCase): | |||
83 | # def test_door(self): | 84 | # def test_door(self): |
84 | # self.assert_(self.__test('door')) | 85 | # self.assertTrue(self.__test('door')) |
85 | # pass | 86 | # pass |
@@ -87,3 +88,3 @@ class TestMarkupParserBasic (unittest.TestCase): | |||
87 | # def test_drzwi(self): | 88 | # def test_drzwi(self): |
88 | # self.assert_(self.__test('drzwi')) | 89 | # self.assertTrue(self.__test('drzwi')) |
89 | # pass | 90 | # pass |
@@ -95,2 +96,3 @@ class TestMarkupParserBasic (unittest.TestCase): | |||
95 | buf = ''.join(fh.readlines()).strip() | 96 | buf = ''.join(fh.readlines()).strip() |
97 | fh.close() | ||
96 | hwm = wiki2html.HtmlWiktionaryMarkup(filename=name_in, lang="pl") | 98 | hwm = wiki2html.HtmlWiktionaryMarkup(filename=name_in, lang="pl") |
@@ -102,4 +104,4 @@ class TestMarkupParserBasic (unittest.TestCase): | |||
102 | # fail | 104 | # fail |
103 | print "\n>>>%s<<<" % buf | 105 | print("\n>>>%s<<<" % buf) |
104 | print ">>>%s<<<" % str(hwm).strip() | 106 | print(">>>%s<<<" % str(hwm).strip()) |
105 | return False | 107 | return False |