Skip to content

Commit 910077d

Browse files
authored
Implement _stat module (#5847)
* Implement _stat module * Allow 'FIRMLINK' term
1 parent ac26be7 commit 910077d

File tree

4 files changed

+579
-34
lines changed

4 files changed

+579
-34
lines changed

.cspell.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@
133133
// win32
134134
"birthtime",
135135
"IFEXEC",
136+
// "stat"
137+
"FIRMLINK"
136138
],
137139
// flagWords - list of words to be always considered incorrect
138140
"flagWords": [

Lib/test/test_stat.py

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -240,40 +240,10 @@ class TestFilemodeCStat(TestFilemode, unittest.TestCase):
240240
statmod = c_stat
241241

242242
# TODO: RUSTPYTHON
243-
@unittest.expectedFailure
244-
def test_devices(self):
245-
super().test_devices()
246-
247-
# TODO: RUSTPYTHON
248-
@unittest.expectedFailure
249-
def test_directory(self):
250-
super().test_directory()
251-
252-
# TODO: RUSTPYTHON
253-
@unittest.expectedFailure
254-
def test_file_attribute_constants(self):
255-
super().test_file_attribute_constants()
256-
257-
# TODO: RUSTPYTHON
258-
@unittest.expectedFailure
259-
def test_link(self):
260-
super().test_link()
261-
262-
# TODO: RUSTPYTHON
263-
@unittest.expectedFailure
264-
def test_mode(self):
265-
super().test_mode()
266-
267-
# TODO: RUSTPYTHON
268-
@unittest.expectedFailure
269-
def test_module_attributes(self):
270-
super().test_module_attributes()
271-
272-
# TODO: RUSTPYTHON
273-
@unittest.expectedFailure
274-
def test_socket(self):
275-
super().test_socket()
276-
243+
if sys.platform == "win32":
244+
@unittest.expectedFailure
245+
def test_link(self):
246+
super().test_link()
277247

278248
class TestFilemodePyStat(TestFilemode, unittest.TestCase):
279249
statmod = py_stat

vm/src/stdlib/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ mod operator;
1414
// TODO: maybe make this an extension module, if we ever get those
1515
// mod re;
1616
mod sre;
17+
mod stat;
1718
mod string;
1819
#[cfg(feature = "compiler")]
1920
mod symtable;
@@ -89,6 +90,7 @@ pub fn get_module_inits() -> StdlibMap {
8990
"_operator" => operator::make_module,
9091
"_signal" => signal::make_module,
9192
"_sre" => sre::make_module,
93+
"_stat" => stat::make_module,
9294
"_string" => string::make_module,
9395
"time" => time::make_module,
9496
"_typing" => typing::make_module,

0 commit comments

Comments
 (0)