Skip to content

Commit d79ac2d

Browse files
committed
Skip ansi related test with PythonScript3 version
1 parent 16c8123 commit d79ac2d

File tree

2 files changed

+25
-14
lines changed

2 files changed

+25
-14
lines changed

PythonScript/python_tests/tests/test_ReplaceAnsiPythonFunction.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,15 @@ def tearDown(self):
3333
editor.setSavePoint()
3434
notepad.close()
3535

36+
@unittest.skipIf(notepad.getPluginVersion()[0] == '3', "not yet py3-compatible")
3637
def test_replace_function(self):
3738
editor.rereplace(r'([a-z]+)([0-9]+)'.encode('windows-1252'), group2_with_counter)
3839
text = editor.getText()
3940
self.assertEqual(text, u'1231 54322 983\r\nä1234 ü54325 ö986\r\n'.encode('windows-1252'))
4041

42+
@unittest.skipIf(notepad.getPluginVersion()[0] == '3', "not yet py3-compatible")
4143
def test_unicode_replace_function(self):
42-
editor.rereplace(ur'([a-zäöü]+)([0-9]+)', group1_with_counter)
44+
editor.rereplace(r'([a-zäöü]+)([0-9]+)', group1_with_counter)
4345
text = editor.getText()
4446
self.assertEqual(text, u'abc1 def2 gh3\r\näbc4 üef5 öh6\r\n'.encode('windows-1252'))
4547

@@ -55,24 +57,27 @@ def groups_check(self, m):
5557
self.assertEqual(m.groups(), groups_data_correct[counter])
5658
return counter
5759

60+
@unittest.skipIf(notepad.getPluginVersion()[0] == '3', "not yet py3-compatible")
5861
def test_groups(self):
59-
editor.rereplace(ur'([a-zäöü]+)([0-9]+)', lambda m: self.groups_check(m))
62+
editor.rereplace(r'([a-zäöü]+)([0-9]+)', lambda m: self.groups_check(m))
6063
text = editor.getText()
6164
self.assertEqual(text, '1 2 3\r\n4 5 6\r\n')
6265

63-
66+
@unittest.skipIf(notepad.getPluginVersion()[0] == '3', "not yet py3-compatible")
6467
def test_groups_with_named_groups(self):
65-
editor.rereplace(ur'(?<letters>[a-zäöü]+)(?<numbers>[0-9]+)', lambda m: self.groups_check(m))
68+
editor.rereplace(r'(?<letters>[a-zäöü]+)(?<numbers>[0-9]+)', lambda m: self.groups_check(m))
6669
text = editor.getText()
6770
self.assertEqual(text, '1 2 3\r\n4 5 6\r\n')
6871

72+
@unittest.skipIf(notepad.getPluginVersion()[0] == '3', "not yet py3-compatible")
6973
def test_named_groups(self):
70-
editor.rereplace(ur'(?<letters>[a-zäöü]+)(?<numbers>[0-9]+)', lambda m: m.group('letters'))
74+
editor.rereplace(r'(?<letters>[a-zäöü]+)(?<numbers>[0-9]+)', lambda m: m.group('letters'))
7175
text = editor.getText()
7276
self.assertEqual(text, u'abc def gh\r\näbc üef öh\r\n'.encode('windows-1252'))
7377

78+
@unittest.skipIf(notepad.getPluginVersion()[0] == '3', "not yet py3-compatible")
7479
def test_named_groups_2(self):
75-
editor.rereplace(ur'(?<letters>[a-zäöü]+)(?<numbers>[0-9]+)', lambda m: m.group('numbers'))
80+
editor.rereplace(r'(?<letters>[a-zäöü]+)(?<numbers>[0-9]+)', lambda m: m.group('numbers'))
7681
text = editor.getText()
7782
self.assertEqual(text, '123 5432 98\r\n123 5432 98\r\n')
7883

@@ -89,8 +94,9 @@ def group_tuples_check(self, m):
8994
self.assertEqual(m.group(2, 'letters', 'numbers'), groups_data_correct[counter])
9095
return counter
9196

97+
@unittest.skipIf(notepad.getPluginVersion()[0] == '3', "not yet py3-compatible")
9298
def test_group_tuples(self):
93-
editor.rereplace(ur'(?<letters>[a-zäöü]+)(?<numbers>[0-9]+)', lambda m: self.group_tuples_check(m))
99+
editor.rereplace(r'(?<letters>[a-zäöü]+)(?<numbers>[0-9]+)', lambda m: self.group_tuples_check(m))
94100
text = editor.getText()
95101
self.assertEqual(text, '1 2 3\r\n4 5 6\r\n')
96102

PythonScript/python_tests/tests/test_ReplaceAnsiTestCase.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,32 @@ class ReplaceAnsiTestCase(unittest.TestCase):
66
def setUp(self):
77
notepad.new()
88
notepad.runMenuCommand("Encoding", "Convert to ANSI")
9-
editor.write(u'Here is some text\r\nWith some umlauts XäXüXö\r\n'.encode('windows-1252'));
9+
editor.write(u'Here is some text\r\nWith some umlauts XäXüXö\r\n'.encode('windows-1252'))
10+
1011

1112
def tearDown(self):
1213
editor.setSavePoint()
1314
notepad.close()
1415

16+
@unittest.skipIf(notepad.getPluginVersion()[0] == '3', "not yet py3-compatible")
1517
def test_simple_replace(self):
16-
editor.rereplace(r'some\s([a-z]+)', 'TEST');
18+
editor.rereplace(r'some\s([a-z]+)', 'TEST')
1719
text = editor.getText()
18-
self.assertEqual(text, u'Here is TEST\r\nWith TEST XäXüXö\r\n'.encode('windows-1252'));
20+
self.assertEqual(text, u'Here is TEST\r\nWith TEST XäXüXö\r\n'.encode('windows-1252'))
1921

22+
@unittest.skipIf(notepad.getPluginVersion()[0] == '3', "not yet py3-compatible")
2023
def test_ansi_replace(self):
21-
editor.rereplace(u'X[äö]'.encode('windows-1252'), 'YY');
24+
editor.rereplace(u'X[äö]'.encode('windows-1252'), 'YY')
2225
text = editor.getText()
23-
self.assertEqual(text, u'Here is some text\r\nWith some umlauts YYXüYY\r\n'.encode('windows-1252'));
26+
self.assertEqual(text, u'Here is some text\r\nWith some umlauts YYXüYY\r\n'.encode('windows-1252'))
2427

28+
@unittest.skipIf(notepad.getPluginVersion()[0] == '3', "not yet py3-compatible")
2529
def test_unicode_replace(self):
26-
editor.rereplace(u'X[äö]', 'PP');
30+
editor.rereplace(u'X[äö]', 'PP')
2731
text = editor.getText()
28-
self.assertEqual(text, u'Here is some text\r\nWith some umlauts PPXüPP\r\n'.encode('windows-1252'));
32+
self.assertEqual(text, u'Here is some text\r\nWith some umlauts PPXüPP\r\n'.encode('windows-1252'))
2933

34+
@unittest.skipIf(notepad.getPluginVersion()[0] == '3', "not yet py3-compatible")
3035
def test_replace_with_unicode(self):
3136
editor.rereplace('Here|With', u'XäöüY')
3237
text = editor.getText()

0 commit comments

Comments
 (0)