def test_success(self): """Ensure command is run when test succeeds.""" rc = ReloadConf(self.dir, self.file, '/bin/sleep 1', test='/bin/true') rc.poll() # Command should have run. self.assertTrue(rc.check_command())
def test_no_test(self): """Ensure command is run when test is omitted.""" rc = ReloadConf(self.dir, self.file, '/bin/sleep 1') rc.poll() # Command should have run. self.assertTrue(rc.check_command())
def test_fail(self): """Ensure command is NOT run when test fails.""" rc = ReloadConf(self.dir, self.file, '/bin/sleep 1', test='/bin/false') rc.poll() # Command should NOT have run. self.assertFalse(rc.check_command())