Example #1
0
    def test_set_get_version(self):
        """
        Application version accessors behave properly
        """
        application = Application()
        application.set_version("bar")

        self.assertEqual("bar", application.get_version(), msg=".set_version() sets the version of the application")
Example #2
0
    def test_set_get_version(self):
        """
        Application version accessors behave properly
        """
        application = Application()
        application.set_version('bar')

        self.assertEqual('bar',
                         application.get_version(),
                         msg='.set_version() sets the version of the application')
Example #3
0
    def test_constructor(self):
        """
        Application.__init__() behaves properly
        """
        application = Application('foo', 'bar')

        self.assertEqual('foo',
                         application.get_name(),
                         msg='__init__() takes the application name as its first argument')
        self.assertEqual('bar',
                         application.get_version(),
                         msg='__init__() takes the application version as its second argument')
        self.assertEqual(['help', 'list'].sort(),
                         list(application.all().keys()).sort(),
                         msg='__init__() registered the help and list commands by default')
Example #4
0
    def test_constructor(self):
        """
        Application.__init__() behaves properly
        """
        application = Application("foo", "bar")

        self.assertEqual(
            "foo", application.get_name(), msg="__init__() takes the application name as its first argument"
        )
        self.assertEqual(
            "bar", application.get_version(), msg="__init__() takes the application version as its second argument"
        )
        self.assertEqual(
            ["help", "list"].sort(),
            list(application.all().keys()).sort(),
            msg="__init__() registered the help and list commands by default",
        )