Mercurial > hg
comparison tests/hghave.py @ 16969:6d1673107143
tests/hghave: test that a fifo actually can be created on the filesystem
Some tests were failing on FAT filesystems.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Fri, 15 Jun 2012 00:02:27 +0200 |
parents | 456f457e376d |
children | 8be2a28cc782 |
comparison
equal
deleted
inserted
replaced
16968:456f457e376d | 16969:6d1673107143 |
---|---|
98 return True | 98 return True |
99 except ImportError: | 99 except ImportError: |
100 return False | 100 return False |
101 | 101 |
102 def has_fifo(): | 102 def has_fifo(): |
103 return getattr(os, "mkfifo", None) is not None | 103 if getattr(os, "mkfifo", None) is None: |
104 return False | |
105 name = tempfile.mktemp(dir='.', prefix=tempprefix) | |
106 try: | |
107 os.mkfifo(name) | |
108 os.unlink(name) | |
109 return True | |
110 except OSError: | |
111 return False | |
104 | 112 |
105 def has_cacheable_fs(): | 113 def has_cacheable_fs(): |
106 from mercurial import util | 114 from mercurial import util |
107 | 115 |
108 fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix) | 116 fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix) |