16 #include "tensorflow_serving/core/test_util/fake_storage_path_source_adapter.h"
20 #include "tensorflow/core/lib/core/errors.h"
22 namespace tensorflow {
26 FakeStoragePathSourceAdapter::FakeStoragePathSourceAdapter(
27 const string& suffix, std::function<
void(
const string&)> call_on_destruct)
28 : suffix_(suffix), call_on_destruct_(call_on_destruct) {}
30 FakeStoragePathSourceAdapter::~FakeStoragePathSourceAdapter() {
32 if (call_on_destruct_) {
33 call_on_destruct_(suffix_);
37 Status FakeStoragePathSourceAdapter::Convert(
38 const StoragePath& data, StoragePath*
const converted_data) {
39 if (data ==
"invalid") {
40 return errors::InvalidArgument(
41 "FakeStoragePathSourceAdapter Convert() dutifully failing on "
46 suffix_.empty() ? data : strings::StrCat(data,
"/", suffix_);