Commit 5712d554 authored by Thomas Perret's avatar Thomas Perret

Add tests for tesseract dev version and remove useless code

parent 6165877e
......@@ -446,9 +446,6 @@ def get_version():
try:
ver_string = ver_string.split(" ")[1]
index = ver_string.find("dev")
if index:
ver_string = ver_string[:index]
els = ver_string.split(".")
els = [digits_only(x) for x in els]
......
......@@ -48,6 +48,18 @@ class TestTesseract(BaseTest):
Popen.return_value = self.stdout
self.assertSequenceEqual(tesseract.get_version(), (4, 0, 0))
@patch("subprocess.Popen")
def test_version_tesseract4dev(self, Popen):
message = (
"tesseract 4.00.00dev2\n leptonica-1.74.4\n"
" libgif 5.1.4 : libjpeg 6b (libjpeg-turbo 1.5.1) : libpng 1.6.34 "
": libtiff 4.0.9 : zlib 1.2.8 : libwebp 0.6.0 : libopenjp2 2.3.0\n"
"\n Found AVX\n Found SSE\n"
)
self.stdout.stdout.read.return_value = message.encode()
Popen.return_value = self.stdout
self.assertSequenceEqual(tesseract.get_version(), (4, 0, 0))
@patch("subprocess.Popen")
def test_version_tesseract4alpha(self, Popen):
message = (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment