aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/util/memmapped_file_system_test.cc
diff options
context:
space:
mode:
authorGravatar Jonathan Hseu <jhseu@google.com>2016-11-04 11:53:50 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-11-04 13:05:51 -0700
commit879e0accd1c833771c8058d3eb5f2d4f06f895d4 (patch)
tree81635e1bd758cd8a8e5ec760db70fc72f6480c66 /tensorflow/core/util/memmapped_file_system_test.cc
parenta2c8e99777cc0b961fb42106af5bd527a43e76f7 (diff)
Change FileExists to return tensorflow::Status.
Also done separately by @llhe at github.com/tensorflow/tensorflow/pull/5370. We needed to do this change internally to fix all callers. Motivation: The existing FileExists interface doesn't allow callers to distinguish between file not found vs. filesystem errors. Semantics changes: - gfile.Exists in Python now throws an exception for filesystem errors. It continues to return true/false if it can accurately determine whether a file exists. - RecursivelyCreateDir now returns errors for filesystem errors when calling FileExists. Change: 138224013
Diffstat (limited to 'tensorflow/core/util/memmapped_file_system_test.cc')
-rw-r--r--tensorflow/core/util/memmapped_file_system_test.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/tensorflow/core/util/memmapped_file_system_test.cc b/tensorflow/core/util/memmapped_file_system_test.cc
index a209ef8b9b..c7d919041a 100644
--- a/tensorflow/core/util/memmapped_file_system_test.cc
+++ b/tensorflow/core/util/memmapped_file_system_test.cc
@@ -102,8 +102,9 @@ TEST(MemmappedFileSystemTest, SimpleTest) {
.code());
// Check FileExists.
- EXPECT_TRUE(memmapped_env.FileExists(kTensor2FileName));
- EXPECT_FALSE(memmapped_env.FileExists("bla-bla-bla"));
+ TF_EXPECT_OK(memmapped_env.FileExists(kTensor2FileName));
+ EXPECT_EQ(error::Code::NOT_FOUND,
+ memmapped_env.FileExists("bla-bla-bla").code());
}
TEST(MemmappedFileSystemTest, NotInitalized) {