"\"updated\": \"2016-04-29T23:15:24.896Z\"}")),
new FakeHttpRequest(
"Uri: https://www.googleapis.com/storage/v1/b/bucket/o/"
- "path%2Fsubfolder?fields=size%2Cgeneration%2Cupdated\n"
+ "path%2Fsubfolder%2F?fields=size%2Cgeneration%2Cupdated\n"
"Auth Token: fake_token\n"
"Timeouts: 5 1 10\n",
"", errors::NotFound("404"), 404),
// HTTP requests.
for (int i = 0; i < 10; i++) {
TF_EXPECT_OK(fs.FileExists("gs://bucket/path/file1.txt"));
- TF_EXPECT_OK(fs.FileExists("gs://bucket/path/subfolder"));
+ TF_EXPECT_OK(fs.FileExists("gs://bucket/path/subfolder/"));
}
}
"Range: 0-15\n"
"Timeouts: 5 1 20\n",
"76543210"),
+ // IsDirectory is checking whether there are children objects.
+ new FakeHttpRequest(
+ "Uri: https://www.googleapis.com/storage/v1/b/bucket/o?"
+ "fields=items%2Fname%2CnextPageToken&prefix=path%2Fsrc.txt%2F"
+ "&maxResults=1\n"
+ "Auth Token: fake_token\n"
+ "Timeouts: 5 1 10\n",
+ "{}"),
// Copying to the new location.
new FakeHttpRequest(
"Uri: https://www.googleapis.com/storage/v1/b/bucket/o/"
"\"updated\": \"2016-04-29T23:15:24.896Z\"}")),
new FakeHttpRequest(
"Uri: https://www.googleapis.com/storage/v1/b/bucket/o/"
- "subfolder?fields=size%2Cgeneration%2Cupdated\n"
+ "subfolder%2F?fields=size%2Cgeneration%2Cupdated\n"
"Auth Token: fake_token\n"
"Timeouts: 5 1 10\n",
"", errors::NotFound("404"), 404),
EXPECT_EQ(1010, stat.length);
EXPECT_NEAR(1461971724896, stat.mtime_nsec / 1000 / 1000, 1);
EXPECT_FALSE(stat.is_directory);
- TF_EXPECT_OK(fs.Stat("gs://bucket/subfolder", &stat));
+ TF_EXPECT_OK(fs.Stat("gs://bucket/subfolder/", &stat));
EXPECT_EQ(0, stat.length);
EXPECT_EQ(0, stat.mtime_nsec);
EXPECT_TRUE(stat.is_directory);