summaryrefslogtreecommitdiff
path: root/Lib/test/test_stat.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_stat.py')
-rw-r--r--Lib/test/test_stat.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_stat.py b/Lib/test/test_stat.py
index 73cd901bdb..38ff2bcf8a 100644
--- a/Lib/test/test_stat.py
+++ b/Lib/test/test_stat.py
@@ -1,5 +1,6 @@
import unittest
import os
+import socket
import sys
from test.support import TESTFN, import_fresh_module
@@ -191,6 +192,14 @@ class TestFilemode:
self.assertS_IS("BLK", st_mode)
break
+ @unittest.skipUnless(hasattr(socket, 'AF_UNIX'), 'requires unix socket')
+ def test_socket(self):
+ with socket.socket(socket.AF_UNIX) as s:
+ s.bind(TESTFN)
+ st_mode, modestr = self.get_mode()
+ self.assertEqual(modestr[0], 's')
+ self.assertS_IS("SOCK", st_mode)
+
def test_module_attributes(self):
for key, value in self.stat_struct.items():
modvalue = getattr(self.statmod, key)