mirror of
https://github.com/curl/curl.git
synced 2026-08-25 10:03:37 +03:00
mbedtls: fix pytest for newer versions
Fix the expectations in pytest for newer versions of mbedtls Closes #13132
This commit is contained in:
parent
79cdae4fc7
commit
3d0fd382a2
3 changed files with 24 additions and 13 deletions
|
|
@ -185,15 +185,15 @@ class EnvConfig:
|
|||
log.error(f'{self.apxs} failed to run: {e}')
|
||||
return self._httpd_version
|
||||
|
||||
def _versiontuple(self, v):
|
||||
def versiontuple(self, v):
|
||||
v = re.sub(r'(\d+\.\d+(\.\d+)?)(-\S+)?', r'\1', v)
|
||||
return tuple(map(int, v.split('.')))
|
||||
|
||||
def httpd_is_at_least(self, minv):
|
||||
if self.httpd_version is None:
|
||||
return False
|
||||
hv = self._versiontuple(self.httpd_version)
|
||||
return hv >= self._versiontuple(minv)
|
||||
hv = self.versiontuple(self.httpd_version)
|
||||
return hv >= self.versiontuple(minv)
|
||||
|
||||
def is_complete(self) -> bool:
|
||||
return os.path.isfile(self.httpd) and \
|
||||
|
|
@ -275,6 +275,14 @@ class Env:
|
|||
return lversion[len(prefix):]
|
||||
return 'unknown'
|
||||
|
||||
@staticmethod
|
||||
def curl_lib_version_at_least(libname: str, min_version) -> str:
|
||||
lversion = Env.curl_lib_version(libname)
|
||||
if lversion != 'unknown':
|
||||
return Env.CONFIG.versiontuple(min_version) <= \
|
||||
Env.CONFIG.versiontuple(lversion)
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
def curl_os() -> str:
|
||||
return Env.CONFIG.curl_props['os']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue