summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_fcntl.py
diff options
context:
space:
mode:
authorVinay Sharma <vinay04sharma@icloud.com>2019-08-29 01:56:17 (GMT)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-08-29 01:56:17 (GMT)
commit13f37f2ba8b1fa39f312dca920e847d9c0313c77 (patch)
treec7e61cf2549b54e70ab574ba7df923487f84b0b9 /Lib/test/test_fcntl.py
parente4a5e9b5bb69025eb879cb133259667241d61a1f (diff)
downloadcpython-13f37f2ba8b1fa39f312dca920e847d9c0313c77.zip
cpython-13f37f2ba8b1fa39f312dca920e847d9c0313c77.tar.gz
cpython-13f37f2ba8b1fa39f312dca920e847d9c0313c77.tar.bz2
closes bpo-37964: add F_GETPATH command to fcntl (GH-15550)
https://bugs.python.org/issue37964 Automerge-Triggered-By: @benjaminp
Diffstat (limited to 'Lib/test/test_fcntl.py')
-rw-r--r--Lib/test/test_fcntl.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_fcntl.py b/Lib/test/test_fcntl.py
index 5d4abe3..38097db 100644
--- a/Lib/test/test_fcntl.py
+++ b/Lib/test/test_fcntl.py
@@ -144,6 +144,12 @@ class TestFcntl(unittest.TestCase):
self.assertRaises(OverflowError, fcntl.flock, _testcapi.INT_MAX+1,
fcntl.LOCK_SH)
+ @unittest.skipIf(sys.platform != 'darwin', "F_GETPATH is only available on macos")
+ def test_fcntl_f_getpath(self):
+ self.f = open(TESTFN, 'wb')
+ abspath = os.path.abspath(TESTFN)
+ res = fcntl.fcntl(self.f.fileno(), fcntl.F_GETPATH, bytes(len(abspath)))
+ self.assertEqual(abspath, res.decode('utf-8'))
def test_main():
run_unittest(TestFcntl)