MCPcopy Create free account
hub / github.com/cloudpipe/cloudpickle / test_r_mode

Method test_r_mode

tests/cloudpickle_file_test.py:41–49  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

39 os.remove(self.tmpfilepath)
40
41 def test_r_mode(self):
42 # Write & close
43 with open(self.tmpfilepath, "w") as f:
44 f.write(self.teststring)
45 # Open for reading
46 with open(self.tmpfilepath) as f:
47 new_f = pickle.loads(cloudpickle.dumps(f))
48 self.assertEqual(self.teststring, new_f.read())
49 os.remove(self.tmpfilepath)
50
51 def test_w_mode(self):
52 with open(self.tmpfilepath, "w") as f:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected