twisted.scripts.tap2rpm.MyOptions

Here are the examples of the python api twisted.scripts.tap2rpm.MyOptions taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

9 Examples 7

Example 1

Project: mythbox Source File: test_tap2rpm.py
Function: test_protocolcalculatedfromtapfile
    def test_protocolCalculatedFromTapFile(self):
        """
        The protocol name defaults to a value based on the tapfile value.
        """
        config = tap2rpm.MyOptions()
        config.parseOptions(['--tapfile', 'pancakes.tap'])

        self.assertEquals(config['tapfile'], 'pancakes.tap')
        self.assertEquals(config['protocol'], 'pancakes')

Example 2

Project: mythbox Source File: test_tap2rpm.py
Function: test_releasenamedefaultstorpmfilevalue
    def test_releaseNameDefaultsToRpmfileValue(self):
        """
        The release-name option is calculated from rpmfile and set-version.
        """
        config = tap2rpm.MyOptions()
        config.parseOptions([
                "--rpmfile", "beans",
                "--set-version", "1.2.3",
            ])

        self.assertEquals(config['release-name'], 'beans-1.2.3')

Example 3

Project: SubliminalCollaborator Source File: test_tap2rpm.py
Function: test_protocolcalculatedfromtapfile
    def test_protocolCalculatedFromTapFile(self):
        """
        The protocol name defaults to a value based on the tapfile value.
        """
        config = tap2rpm.MyOptions()
        config.parseOptions(['--tapfile', 'pancakes.tap'])

        self.assertEqual(config['tapfile'], 'pancakes.tap')
        self.assertEqual(config['protocol'], 'pancakes')

Example 4

Project: SubliminalCollaborator Source File: test_tap2rpm.py
Function: test_releasenamedefaultstorpmfilevalue
    def test_releaseNameDefaultsToRpmfileValue(self):
        """
        The release-name option is calculated from rpmfile and set-version.
        """
        config = tap2rpm.MyOptions()
        config.parseOptions([
                "--rpmfile", "beans",
                "--set-version", "1.2.3",
            ])

        self.assertEqual(config['release-name'], 'beans-1.2.3')

Example 5

Project: SubliminalCollaborator Source File: test_tap2rpm.py
    def test_unsignedFlagDeprecationWarning(self):
        """
        The 'unsigned' flag in tap2rpm should be deprecated, and its use
        should raise a warning as such.
        """
        config = tap2rpm.MyOptions()
        config.parseOptions(['--unsigned'])
        warnings = self.flushWarnings()
        self.assertEqual(DeprecationWarning, warnings[0]['category'])
        self.assertEqual(
            deprecate.getDeprecationWarningString(
                config.opt_unsigned, versions.Version("Twisted", 12, 1, 0)),
            warnings[0]['message'])
        self.assertEqual(1, len(warnings))

Example 6

Project: mythbox Source File: test_tap2rpm.py
Function: test_optiondefaults
    def test_optionDefaults(self):
        """
        Commandline options should default to sensible values.

        "sensible" here is defined as "the same values that previous versions
        defaulted to".
        """
        config = tap2rpm.MyOptions()
        config.parseOptions([])

        self.assertEquals(config['tapfile'], 'twistd.tap')
        self.assertEquals(config['maintainer'], 'tap2rpm')
        self.assertEquals(config['protocol'], 'twistd')
        self.assertEquals(config['description'], 'A TCP server for twistd')
        self.assertEquals(config['long_description'],
                'Automatically created by tap2rpm')
        self.assertEquals(config['set-version'], '1.0')
        self.assertEquals(config['rpmfile'], 'twisted-twistd')
        self.assertEquals(config['type'], 'tap')
        self.assertEquals(config['quiet'], False)
        self.assertEquals(config['twistd_option'], 'file')
        self.assertEquals(config['release-name'], 'twisted-twistd-1.0')

Example 7

Project: mythbox Source File: test_tap2rpm.py
Function: test_optionsdefaulttoprotocolvalue
    def test_optionsDefaultToProtocolValue(self):
        """
        Many options default to a value calculated from the protocol name.
        """
        config = tap2rpm.MyOptions()
        config.parseOptions([
                '--tapfile', 'sausages.tap',
                '--protocol', 'eggs',
            ])

        self.assertEquals(config['tapfile'], 'sausages.tap')
        self.assertEquals(config['maintainer'], 'tap2rpm')
        self.assertEquals(config['protocol'], 'eggs')
        self.assertEquals(config['description'], 'A TCP server for eggs')
        self.assertEquals(config['long_description'],
                'Automatically created by tap2rpm')
        self.assertEquals(config['set-version'], '1.0')
        self.assertEquals(config['rpmfile'], 'twisted-eggs')
        self.assertEquals(config['type'], 'tap')
        self.assertEquals(config['quiet'], False)
        self.assertEquals(config['twistd_option'], 'file')
        self.assertEquals(config['release-name'], 'twisted-eggs-1.0')

Example 8

Project: SubliminalCollaborator Source File: test_tap2rpm.py
Function: test_optiondefaults
    def test_optionDefaults(self):
        """
        Commandline options should default to sensible values.

        "sensible" here is defined as "the same values that previous versions
        defaulted to".
        """
        config = tap2rpm.MyOptions()
        config.parseOptions([])

        self.assertEqual(config['tapfile'], 'twistd.tap')
        self.assertEqual(config['maintainer'], 'tap2rpm')
        self.assertEqual(config['protocol'], 'twistd')
        self.assertEqual(config['description'], 'A TCP server for twistd')
        self.assertEqual(config['long_description'],
                'Automatically created by tap2rpm')
        self.assertEqual(config['set-version'], '1.0')
        self.assertEqual(config['rpmfile'], 'twisted-twistd')
        self.assertEqual(config['type'], 'tap')
        self.assertEqual(config['quiet'], False)
        self.assertEqual(config['twistd_option'], 'file')
        self.assertEqual(config['release-name'], 'twisted-twistd-1.0')

Example 9

Project: SubliminalCollaborator Source File: test_tap2rpm.py
Function: test_optionsdefaulttoprotocolvalue
    def test_optionsDefaultToProtocolValue(self):
        """
        Many options default to a value calculated from the protocol name.
        """
        config = tap2rpm.MyOptions()
        config.parseOptions([
                '--tapfile', 'sausages.tap',
                '--protocol', 'eggs',
            ])

        self.assertEqual(config['tapfile'], 'sausages.tap')
        self.assertEqual(config['maintainer'], 'tap2rpm')
        self.assertEqual(config['protocol'], 'eggs')
        self.assertEqual(config['description'], 'A TCP server for eggs')
        self.assertEqual(config['long_description'],
                'Automatically created by tap2rpm')
        self.assertEqual(config['set-version'], '1.0')
        self.assertEqual(config['rpmfile'], 'twisted-eggs')
        self.assertEqual(config['type'], 'tap')
        self.assertEqual(config['quiet'], False)
        self.assertEqual(config['twistd_option'], 'file')
        self.assertEqual(config['release-name'], 'twisted-eggs-1.0')