1# encoding=UTF-8 2 3# Copyright © 2015-2016 Jakub Wilk <jwilk@jwilk.net> 4# 5# This file is part of pdf2djvu. 6# 7# pdf2djvu is free software; you can redistribute it and/or modify 8# it under the terms of the GNU General Public License version 2 as 9# published by the Free Software Foundation. 10# 11# pdf2djvu is distributed in the hope that it will be useful, but 12# WITHOUT ANY WARRANTY; without even the implied warranty of 13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14# General Public License for more details. 15 16from tools import ( 17 case, 18 assert_greater, 19 count_ppm_colors, 20) 21 22class test(case): 23 # Bug: https://github.com/jwilk/pdf2djvu/issues/115 24 # + introduced in 0.7.1 [a9440040faf697bc11370e8012ba586e88e4dca4] 25 # + introduced in 0.7.10 [da7cd2524b329a80581b939037f4d42801f3755d] 26 # + fixed in 0.9.3 [93f9032d99b75145a03ce64de9c3ae3e25314541] 27 28 def test(self): 29 self.pdf2djvu() 30 r = self.decode() 31 r.assert_(stdout=None) 32 r = self.decode(mode='foreground') 33 r.assert_(stdout=None) 34 colors = count_ppm_colors(r.stdout) 35 assert_greater(colors.get('\xFF\0\0', 0), 5000) 36 37# vim:ts=4 sts=4 sw=4 et 38