Exemplo n.º 1
0
    def test_set_get_name(self):
        """
        Application name accessors behave properly
        """
        application = Application()
        application.set_name("foo")

        self.assertEqual("foo", application.get_name(), msg=".set_name() sets the name of the application")
Exemplo n.º 2
0
    def test_set_get_name(self):
        """
        Application name accessors behave properly
        """
        application = Application()
        application.set_name('foo')

        self.assertEqual('foo',
                         application.get_name(),
                         msg='.set_name() sets the name of the application')
Exemplo n.º 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')
Exemplo n.º 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",
        )