def test_open_fd(self): with open(self.filename) as g: try: f = clover.open_file(g) self.assertIs(f, g) finally: f.close()
def assertOpenFileOK(self, filename): try: with open(filename) as g: f = clover.open_file(filename) self.assertEqual(f.read(), g.read()) finally: f.close()
def test_open_stdin(self): try: f = clover.open_file(sys.stdin) self.assertIs(f, sys.stdin) finally: f.close()