MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / test_copy

Method test_copy

tensorflow/contrib/ignite/python/tests/igfs_test.py:90–110  ·  view source on GitHub ↗

Test copy.

(self)

Source from the content-addressed store, hash-verified

88 self.assertFalse(gfile.Exists(file_name))
89
90 def test_copy(self):
91 """Test copy.
92
93 """
94 # Setup and check preconditions.
95 src_file_name = "igfs:///test_copy/1"
96 dst_file_name = "igfs:///test_copy/2"
97 self.assertFalse(gfile.Exists(src_file_name))
98 self.assertFalse(gfile.Exists(dst_file_name))
99 with gfile.Open(src_file_name, mode="w") as w:
100 w.write("42")
101 self.assertTrue(gfile.Exists(src_file_name))
102 self.assertFalse(gfile.Exists(dst_file_name))
103 # Copy file.
104 gfile.Copy(src_file_name, dst_file_name)
105 # Check that files are identical.
106 self.assertTrue(gfile.Exists(src_file_name))
107 self.assertTrue(gfile.Exists(dst_file_name))
108 with gfile.Open(dst_file_name, mode="r") as r:
109 data = r.read()
110 self.assertEqual("42", data)
111
112 def test_is_directory(self):
113 """Test is directory.

Callers

nothing calls this directly

Calls 5

ExistsMethod · 0.45
OpenMethod · 0.45
writeMethod · 0.45
CopyMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected