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