예제 #1
0
    def setUp(self):

        """Function:  setUp

        Description:  Initialization for unit testing.

        Arguments:

        """

        self.pidfile = "test/unit/gen_class/testfiles/daemon_pidfile"
        self.pidfile2 = "test/unit/gen_class/testfiles/daemon_pidfile2"
        self.daemon2 = gen_class.Daemon(self.pidfile2)
        self.daemon = gen_class.Daemon(self.pidfile)
예제 #2
0
    def setUp(self):
        """Function:  setUp

        Description:  Initialization for unit testing.

        Arguments:

        """

        self.pidfile = "PidFile"
        self.daemon = gen_class.Daemon(self.pidfile)
예제 #3
0
    def test_default_setting(self):
        """Function:  test_default_setting

        Description:  Test with default settings.

        Arguments:

        """

        daemon_inst = gen_class.Daemon(self.pidfile)

        self.assertEqual((daemon_inst.argv_list, daemon_inst.pidfile),
                         ([], self.pidfile))
예제 #4
0
    def test_stdin_arg(self):
        """Function:  test_stdin_arg

        Description:  Test with stdin arg passed.

        Arguments:

        """

        daemon_inst = gen_class.Daemon(self.pidfile, stdin=self.stdin)

        self.assertEqual((daemon_inst.stdin, daemon_inst.pidfile),
                         (self.stdin, self.pidfile))
예제 #5
0
    def test_argv_list(self):
        """Function:  test_argv_list

        Description:  Test with argv list passed.

        Arguments:

        """

        daemon_inst = gen_class.Daemon(self.pidfile, argv_list=self.argv_list)

        self.assertEqual((daemon_inst.argv_list, daemon_inst.pidfile),
                         (self.argv_list, self.pidfile))