blob: 5d17ab19a9d89afcbca0a9cd681ff9a160e4a7ae [file] [log] [blame]
Tarek Ziadéa6191802009-04-09 22:02:39 +00001"""Tests for distutils.command.bdist_wininst."""
2import unittest
Éric Araujo70ec44a2010-11-06 02:44:43 +00003from test.support import run_unittest
Tarek Ziadéa6191802009-04-09 22:02:39 +00004
5from distutils.command.bdist_wininst import bdist_wininst
6from distutils.tests import support
7
8class BuildWinInstTestCase(support.TempdirManager,
Tarek Ziadéfbd77572009-04-20 12:37:58 +00009 support.LoggingSilencer,
Tarek Ziadéa6191802009-04-09 22:02:39 +000010 unittest.TestCase):
11
12 def test_get_exe_bytes(self):
13
14 # issue5731: command was broken on non-windows platforms
15 # this test makes sure it works now for every platform
16 # let's create a command
17 pkg_pth, dist = self.create_dist()
18 cmd = bdist_wininst(dist)
19 cmd.ensure_finalized()
20
21 # let's run the code that finds the right wininst*.exe file
22 # and make sure it finds it and returns its content
23 # no matter what platform we have
24 exe_file = cmd.get_exe_bytes()
Serhiy Storchaka39989152013-11-17 00:17:46 +020025 self.assertGreater(len(exe_file), 10)
Tarek Ziadéa6191802009-04-09 22:02:39 +000026
27def test_suite():
28 return unittest.makeSuite(BuildWinInstTestCase)
29
30if __name__ == '__main__':
Éric Araujo70ec44a2010-11-06 02:44:43 +000031 run_unittest(test_suite())