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)
def setUp(self): """Function: setUp Description: Initialization for unit testing. Arguments: """ self.pidfile = "PidFile" self.daemon = gen_class.Daemon(self.pidfile)
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))
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))
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))