ยปCore Development>Code coverage>Lib/distutils/tests/test_bdist_wininst.py

Python code coverage for Lib/distutils/tests/test_bdist_wininst.py

#countcontent
1n/a"""Tests for distutils.command.bdist_wininst."""
2n/aimport unittest
3n/afrom test.support import run_unittest
4n/a
5n/afrom distutils.command.bdist_wininst import bdist_wininst
6n/afrom distutils.tests import support
7n/a
8n/aclass BuildWinInstTestCase(support.TempdirManager,
9n/a support.LoggingSilencer,
10n/a unittest.TestCase):
11n/a
12n/a def test_get_exe_bytes(self):
13n/a
14n/a # issue5731: command was broken on non-windows platforms
15n/a # this test makes sure it works now for every platform
16n/a # let's create a command
17n/a pkg_pth, dist = self.create_dist()
18n/a cmd = bdist_wininst(dist)
19n/a cmd.ensure_finalized()
20n/a
21n/a # let's run the code that finds the right wininst*.exe file
22n/a # and make sure it finds it and returns its content
23n/a # no matter what platform we have
24n/a exe_file = cmd.get_exe_bytes()
25n/a self.assertGreater(len(exe_file), 10)
26n/a
27n/adef test_suite():
28n/a return unittest.makeSuite(BuildWinInstTestCase)
29n/a
30n/aif __name__ == '__main__':
31n/a run_unittest(test_suite())