Tarek Ziade | 1231a4e | 2011-05-19 13:07:25 +0200 | [diff] [blame] | 1 | """Tests for distutils.command.bdist_msi.""" |
Éric Araujo | b8e280d | 2012-03-05 17:04:07 +0100 | [diff] [blame^] | 2 | import os |
Tarek Ziade | 1231a4e | 2011-05-19 13:07:25 +0200 | [diff] [blame] | 3 | import sys |
| 4 | |
| 5 | from packaging.tests import unittest, support |
| 6 | |
| 7 | |
Éric Araujo | b8e280d | 2012-03-05 17:04:07 +0100 | [diff] [blame^] | 8 | @unittest.skipUnless(sys.platform == 'win32', 'these tests require Windows') |
Tarek Ziade | 1231a4e | 2011-05-19 13:07:25 +0200 | [diff] [blame] | 9 | class BDistMSITestCase(support.TempdirManager, |
| 10 | support.LoggingCatcher, |
| 11 | unittest.TestCase): |
| 12 | |
Tarek Ziade | 1231a4e | 2011-05-19 13:07:25 +0200 | [diff] [blame] | 13 | def test_minimal(self): |
| 14 | # minimal test XXX need more tests |
| 15 | from packaging.command.bdist_msi import bdist_msi |
Éric Araujo | b8e280d | 2012-03-05 17:04:07 +0100 | [diff] [blame^] | 16 | project_dir, dist = self.create_dist() |
Tarek Ziade | 1231a4e | 2011-05-19 13:07:25 +0200 | [diff] [blame] | 17 | cmd = bdist_msi(dist) |
| 18 | cmd.ensure_finalized() |
Éric Araujo | b8e280d | 2012-03-05 17:04:07 +0100 | [diff] [blame^] | 19 | cmd.run() |
| 20 | |
| 21 | bdists = os.listdir(os.path.join(project_dir, 'dist')) |
| 22 | self.assertEqual(bdists, ['foo-0.1.msi']) |
| 23 | |
| 24 | # bug #13719: upload ignores bdist_msi files |
| 25 | self.assertEqual(dist.dist_files, |
| 26 | [('bdist_msi', 'any', 'dist/foo-0.1.msi')]) |
Tarek Ziade | 1231a4e | 2011-05-19 13:07:25 +0200 | [diff] [blame] | 27 | |
| 28 | |
| 29 | def test_suite(): |
| 30 | return unittest.makeSuite(BDistMSITestCase) |
| 31 | |
| 32 | |
| 33 | if __name__ == '__main__': |
| 34 | unittest.main(defaultTest='test_suite') |