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

Method testReadFile

tensorflow/python/kernel_tests/io_ops_test.py:35–46  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

33
34 @test_util.run_deprecated_v1
35 def testReadFile(self):
36 cases = ['', 'Some contents', 'Неки садржаји на српском']
37 for contents in cases:
38 contents = compat.as_bytes(contents)
39 with tempfile.NamedTemporaryFile(
40 prefix='ReadFileTest', dir=self.get_temp_dir(), delete=False) as temp:
41 temp.write(contents)
42 with self.cached_session():
43 read = io_ops.read_file(temp.name)
44 self.assertEqual([], read.get_shape())
45 self.assertEqual(read.eval(), contents)
46 os.remove(temp.name)
47
48 def testWriteFile(self):
49 cases = ['', 'Some contents']

Callers

nothing calls this directly

Calls 6

get_temp_dirMethod · 0.80
writeMethod · 0.45
cached_sessionMethod · 0.45
get_shapeMethod · 0.45
evalMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected