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