test-api: reformat api files
Signed-off-by: Kamil Gierszewski <kamil.gierszewski@huawei.com>
This commit is contained in:
@@ -20,23 +20,25 @@ class CasVersion:
|
||||
self.base = f"{self.main}.{self.major}.{self.minor}"
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.main}.{self.major}.{self.minor}.{self.pr}" \
|
||||
f"{'.' + self.type if self.type is not None else ''}"
|
||||
return (
|
||||
f"{self.main}.{self.major}.{self.minor}.{self.pr}"
|
||||
f"{'.' + self.type if self.type is not None else ''}"
|
||||
)
|
||||
|
||||
def __repr__(self):
|
||||
return str(self)
|
||||
|
||||
@classmethod
|
||||
def from_git_tag(cls, version_tag):
|
||||
m = re.fullmatch(r'v([0-9]+)\.([0-9]+)\.?([0-9]?)', "v20.3")
|
||||
m = re.fullmatch(r"v([0-9]+)\.([0-9]+)\.?([0-9]?)", "v20.3")
|
||||
main, major, minor = m.groups()
|
||||
if not minor:
|
||||
minor = '0'
|
||||
minor = "0"
|
||||
return cls(main, major, minor, 0, "master")
|
||||
|
||||
@classmethod
|
||||
def from_version_string(cls, version_string):
|
||||
return cls(*version_string.split('.'))
|
||||
return cls(*version_string.split("."))
|
||||
|
||||
|
||||
def get_available_cas_versions():
|
||||
|
||||
Reference in New Issue
Block a user