def test_open_or_none_opener_error(self): def bogus_opener(f): raise IOError('hahaha') with self.assertRaises(IOError): _open_or_none(bogus_opener, self.fna1)
def test_open_or_none_no_opener(self): obs = _open_or_none(None, self.fna1) self.assertTrue(obs is None)