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