Ejemplo n.º 1
0
    def test_unsupported_platform(self):
        _os_name = os.name
        try:
            os.name = 'some-obscure-os'

            dist = self.create_dist()[1]
            cmd = bdist(dist)
            self.assertRaises(PackagingPlatformError, cmd.ensure_finalized)
        finally:
            os.name = _os_name
Ejemplo n.º 2
0
    def test_unsupported_platform(self):
        _os_name = os.name
        try:
            os.name = 'some-obscure-os'

            dist = self.create_dist()[1]
            cmd = bdist(dist)
            self.assertRaises(PackagingPlatformError, cmd.ensure_finalized)
        finally:
            os.name = _os_name
Ejemplo n.º 3
0
    def test_formats(self):
        # let's create a command and make sure
        # we can set the format
        dist = self.create_dist()[1]
        cmd = bdist(dist)
        cmd.formats = ['msi']
        cmd.ensure_finalized()
        self.assertEqual(cmd.formats, ['msi'])

        # what formats does bdist offer?
        # XXX hard-coded lists are not the best way to find available bdist_*
        # commands; we should add a registry
        formats = ['bztar', 'gztar', 'msi', 'tar', 'wininst', 'zip']
        found = sorted(cmd.format_command)
        self.assertEqual(found, formats)
Ejemplo n.º 4
0
    def test_formats(self):
        # let's create a command and make sure
        # we can set the format
        dist = self.create_dist()[1]
        cmd = bdist(dist)
        cmd.formats = ['msi']
        cmd.ensure_finalized()
        self.assertEqual(cmd.formats, ['msi'])

        # what formats does bdist offer?
        # XXX hard-coded lists are not the best way to find available bdist_*
        # commands; we should add a registry
        formats = ['bztar', 'gztar', 'msi', 'tar', 'wininst', 'zip']
        found = sorted(cmd.format_command)
        self.assertEqual(found, formats)
Ejemplo n.º 5
0
    def test_skip_build(self):
        # bug #10946: bdist --skip-build should trickle down to subcommands
        dist = self.create_dist()[1]
        cmd = bdist(dist)
        cmd.skip_build = True
        cmd.ensure_finalized()
        dist.command_obj['bdist'] = cmd

        names = ['bdist_dumb', 'bdist_wininst']
        if os.name == 'nt':
            names.append('bdist_msi')

        for name in names:
            subcmd = cmd.get_finalized_command(name)
            self.assertTrue(subcmd.skip_build,
                            '%s should take --skip-build from bdist' % name)
Ejemplo n.º 6
0
    def test_skip_build(self):
        # bug #10946: bdist --skip-build should trickle down to subcommands
        dist = self.create_dist()[1]
        cmd = bdist(dist)
        cmd.skip_build = True
        cmd.ensure_finalized()
        dist.command_obj['bdist'] = cmd

        names = ['bdist_dumb', 'bdist_wininst']
        if os.name == 'nt':
            names.append('bdist_msi')

        for name in names:
            subcmd = cmd.get_finalized_command(name)
            self.assertTrue(subcmd.skip_build,
                            '%s should take --skip-build from bdist' % name)
Ejemplo n.º 7
0
    def test_formats(self):

        # let's create a command and make sure
        # we can fix the format
        pkg_pth, dist = self.create_dist()
        cmd = bdist(dist)
        cmd.formats = ['msi']
        cmd.ensure_finalized()
        self.assertEqual(cmd.formats, ['msi'])

        # what format bdist offers ?
        # XXX an explicit list in bdist is
        # not the best way to  bdist_* commands
        # we should add a registry
        formats = ['zip', 'gztar', 'bztar', 'ztar', 'tar', 'wininst', 'msi']
        formats.sort()
        found = cmd.format_command.keys()
        found.sort()
        self.assertEqual(found, formats)