Ejemplo n.º 1
0
class FileFieldTest(unittest.TestCase):
    """
    Tests for :class:`lofarpipe.support.lofaringredient.FileField`
    """
    def setUp(self):
        from lofarpipe.support.lofaringredient import FileField
        self.filefield = FileField(default='/')

    def test_validator(self):
        """
        Integers are not valid as filenames, and certainly don't exist on
        disk.

        ``/`` should, though.
        """
        self.assertFalse(self.filefield.is_valid(1))
        self.assertTrue(self.filefield.is_valid("/"))

    def test_default(self):
        """
        Check that default is correctly set.
        """
        self.assertEqual(self.filefield.default, "/")
Ejemplo n.º 2
0
class FileFieldTest(unittest.TestCase):
    """
    Tests for :class:`lofarpipe.support.lofaringredient.FileField`
    """
    def setUp(self):
        from lofarpipe.support.lofaringredient import FileField
        self.filefield = FileField(default='/')

    def test_validator(self):
        """
        Integers are not valid as filenames, and certainly don't exist on
        disk.

        ``/`` should, though.
        """
        self.assertFalse(self.filefield.is_valid(1))
        self.assertTrue(self.filefield.is_valid("/"))

    def test_default(self):
        """
        Check that default is correctly set.
        """
        self.assertEqual(self.filefield.default, "/")
Ejemplo n.º 3
0
 def setUp(self):
     from lofarpipe.support.lofaringredient import FileField
     self.filefield = FileField(default='/')
Ejemplo n.º 4
0
 def setUp(self):
     from lofarpipe.support.lofaringredient import FileField
     self.filefield = FileField(default='/')