def test_legal_types(self):
        logging.debug('')
        logging.debug('test_legal_types')

        # Set mismatched type and verify error message.
        self.model.source.text_file.content_type = 'invalid'
        msg = ": cannot set 'middle.text_in' from 'source.text_file':" \
              " : Content type 'invalid' not one of ['xyzzy', 'txt']"
        try:
            self.model.run()
        except ValueError as exc:
            print exc
            self.assertTrue(msg in str(exc))
        else:
            self.fail('ValueError expected')

        # Set null type and verify error message.
        self.model.source.text_file.content_type = ''
        msg = ": cannot set 'middle.text_in' from 'source.text_file':" \
              " : Content type '' not one of ['xyzzy', 'txt']"
        try:
            self.model.run()
        except __HOLE__ as exc:
            self.assertTrue(msg in str(exc))
        else:
            self.fail('ValueError expected')
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/test/test_filevar.py/TestCase.test_legal_types