Improve MinetestCheck name validation

This commit is contained in:
rubenwardy
2020-08-18 13:34:04 +01:00
parent 6167bdc7f0
commit 0c81d0ae2b
3 changed files with 16 additions and 7 deletions

View File

@@ -24,14 +24,14 @@ class ContentType(Enum):
if self == ContentType.MOD:
if not other.isModLike():
raise MinetestCheckError("expected a mod or modpack, found " + other.value)
raise MinetestCheckError("Expected a mod or modpack, found " + other.value)
elif self == ContentType.TXP:
if other != ContentType.UNKNOWN and other != ContentType.TXP:
raise MinetestCheckError("expected a " + self.value + ", found a " + other.value)
elif other != self:
raise MinetestCheckError("expected a " + self.value + ", found a " + other.value)
raise MinetestCheckError("Expected a " + self.value + ", found a " + other.value)
from .tree import PackageTreeNode, get_base_dir