Skip to content

Commit 826960a

Browse files
committed
Get unit tests passing.
1 parent 10f6803 commit 826960a

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

aws_doc_sdk_examples_tools/doc_gen_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ def test_doc_gen_encoder(sample_doc_gen: DocGen):
253253
assert "examples" in decoded
254254
assert decoded["examples"] == {
255255
"s3_PutObject": {
256+
"suppress_publish": False,
256257
"category": None,
257258
"doc_filenames": None,
258259
"file": "filea.txt",

aws_doc_sdk_examples_tools/fs.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ def __init__(self, fs: Dict[Path, str]):
8585
self.fs = fs
8686

8787
def glob(self, path: Path, glob: str) -> Generator[Path, None, None]:
88-
path_s = str(path)
88+
path_s = path.as_posix()
8989
for key in self.fs.keys():
90-
key_s = str(key)
90+
key_s = key.as_posix()
9191
if key_s.startswith(path_s):
9292
if fnmatch(key_s, glob):
9393
yield key
@@ -100,17 +100,17 @@ def readlines(self, path: Path, encoding: str = "utf-8") -> List[str]:
100100
return content.splitlines(keepends=True)
101101

102102
def write(self, path: Path, content: str):
103-
base = str(path.parent)
103+
base = path.parent.as_posix()
104104
assert any(
105-
[str(key).startswith(base) for key in self.fs]
105+
[key.as_posix().startswith(base) for key in self.fs]
106106
), "No parent folder, this will probably fail without a call to mkdir in a real file system!"
107107
self.fs[path] = content
108108

109109
def stat(self, path: Path):
110110
if path in self.fs:
111111
return Stat(path, True, True)
112112
for item in self.fs.keys():
113-
if str(item).startswith(str(path)):
113+
if item.as_posix().startswith(path.as_posix()):
114114
return Stat(path, True, False)
115115
return Stat(path, False, False)
116116

@@ -123,11 +123,11 @@ def list(self, path: Path) -> List[Path]:
123123
return []
124124

125125
# Gather all entries that are immediate children of `path`
126-
prefix = str(path).rstrip("/") + "/"
126+
prefix = path.as_posix().rstrip("/") + "/"
127127
children = set()
128128

129129
for item in self.fs.keys():
130-
item_s = str(item)
130+
item_s = item.as_posix()
131131
if item_s.startswith(prefix):
132132
# Determine the remainder path after the prefix
133133
remainder = item_s[len(prefix) :]

0 commit comments

Comments
 (0)