MCPcopy Create free account
hub / github.com/apache/mesos / TEST_F

Function TEST_F

src/tests/files_tests.cpp:105–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103
104
105TEST_F(FilesTest, AttachTest)
106{
107 Files files;
108 ASSERT_SOME(os::write("file", "body"));
109 ASSERT_SOME(os::mkdir("dir"));
110
111 AWAIT_EXPECT_READY(files.attach("file", "myname")); // Valid file.
112 AWAIT_EXPECT_READY(files.attach("dir", "mydir")); // Valid dir.
113 AWAIT_EXPECT_READY(files.attach("file", "myname")); // Re-attach.
114 AWAIT_EXPECT_FAILED(files.attach("missing", "somename")); // Missing file.
115
116 auto authorization = [](const Option<Principal>&) { return true; };
117
118 // Attach with required authorization.
119 AWAIT_EXPECT_READY(files.attach("file", "myname", authorization));
120
121 ASSERT_SOME(os::write("file2", "body"));
122
123 AWAIT_EXPECT_READY(files.attach("file2", "myname")); // Overwrite.
124 AWAIT_EXPECT_FAILED(files.attach("$@", "foo")); // Bad path.
125}
126
127
128TEST_F(FilesTest, DetachTest)

Callers

nothing calls this directly

Calls 15

BadRequestClass · 0.85
OKClass · 0.85
ForbiddenClass · 0.85
NotFoundClass · 0.85
createFileInfoFunction · 0.85
ArrayClass · 0.85
NoneClass · 0.85
UnauthorizedClass · 0.85
CopyFromMethod · 0.80
atMethod · 0.80
statClass · 0.70
writeFunction · 0.50

Tested by

no test coverage detected