class ExecFieldTest(unittest.TestCase): """ Tests for :class:`lofarpipe.support.lofaringredient.ExecField` """ def setUp(self): from lofarpipe.support.lofaringredient import ExecField self.execfield = ExecField(default='/bin/ls') def test_validator(self): """ ``/etc/passwd`` should always exist as a file on disk, but not be executable. ``/bin/ls`` should always exist, and must be executable. """ self.assertFalse(self.execfield.is_valid("/etc/passwd")) self.assertTrue(self.execfield.is_valid("/bin/ls")) def test_default(self): """ Check that default is correctly set. """ self.assertEqual(self.execfield.default, "/bin/ls")