Skip to content

Commit 529b811

Browse files
test apertium binaries availability in single test
1 parent fc602b5 commit 529b811

File tree

1 file changed

+8
-23
lines changed

1 file changed

+8
-23
lines changed

tests/__init__.py

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -73,30 +73,15 @@ def test_uninstalled_mode(self):
7373

7474

7575
class TestInstallation(unittest.TestCase):
76-
def __init__(self, *args, **kwargs):
77-
super().__init__(*args, **kwargs)
76+
def test_apertium_installer(self):
7877
apertium.installer.install_apertium()
79-
80-
def test_apertium_transfer(self):
81-
self.assertIsNotNone(shutil.which('apertium-transfer'), 'apertium-transfer not available')
82-
83-
def test_apertium_postchunk(self):
84-
self.assertIsNotNone(shutil.which('apertium-postchunk'), 'apertium-postchunk not available')
85-
86-
def test_apertium_interchunk(self):
87-
self.assertIsNotNone(shutil.which('apertium-interchunk'), 'apertium-interchunk not available')
88-
89-
def test_apertium_pretransfer(self):
90-
self.assertIsNotNone(shutil.which('apertium-pretransfer'), 'apertium-pretransfer not available')
91-
92-
def test_apertium_tagger(self):
93-
self.assertIsNotNone(shutil.which('apertium-tagger'), 'apertium-tagger not available')
94-
95-
def test_lt_proc(self):
96-
self.assertIsNotNone(shutil.which('lt-proc'), 'lt-proc not available')
97-
98-
def test_lrx_proc(self):
99-
self.assertIsNotNone(shutil.which('lrx-proc'), 'lrx-proc not available')
78+
apertium_processes = ['apertium-destxt', 'apertium-interchunk', 'apertium-postchunk',
79+
'apertium-pretransfer', 'apertium-tagger', 'apertium-transfer',
80+
'lrx-proc', 'lt-proc'
81+
]
82+
for process in apertium_processes:
83+
self.assertIsNotNone(shutil.which(process), 'apertium installer not working. {} not available on system path'.format(process))
84+
break
10085

10186
def test_install_module(self):
10287
language = 'kir'

0 commit comments

Comments
 (0)