Skip to content

Commit 06495ca

Browse files
committed
Fix test aasx and check it in ci
1 parent fe2ecd0 commit 06495ca

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

aas_test_engines/__main__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ def run_file_test(argv):
5454
args = parser.parse_args(argv)
5555

5656
if args.format == InputFormats.aasx:
57-
result = file.check_aasx_file(args.file, model_type=args.model_type)
57+
if args.model_type != "Environment":
58+
raise Exception("Cannot set --model_type for --format aasx")
59+
result = file.check_aasx_file(args.file)
5860
elif args.format == InputFormats.json:
5961
result = file.check_json_file(args.file, model_type=args.model_type)
6062
elif args.format == InputFormats.xml:

aas_test_engines/file.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ def check_aasx_data(zipfile: zipfile.ZipFile, version: str = _DEFAULT_VERSION) -
107107
return result
108108

109109

110-
def check_aasx_file(file: TextIO, version: str = _DEFAULT_VERSION, model_type: str = "Environment") -> AasTestResult:
110+
def check_aasx_file(file: TextIO, version: str = _DEFAULT_VERSION) -> AasTestResult:
111111
try:
112112
zip = zipfile.ZipFile(file)
113113
except zipfile.BadZipFile as e:
114114
return AasTestResult(f"Cannot read: {e}", level=Level.ERROR)
115115

116-
return check_aasx_data(zip, version, model_type)
116+
return check_aasx_data(zip, version)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:61ce8cb58a5805f5fc4ae9aa09748652a294c06ea10f8fcbb1840ed02431afac
3-
size 59303
2+
oid sha256:ee9c2f9e8793ac04bdf22e3535f71619c987f27cd9584e859275d9d9ad674ab8
3+
size 59363

test/acceptance/file.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,8 @@ def run(dirname: str, check):
6767
start = time.time()
6868
run("Json", file.check_json_file)
6969
run("Xml", file.check_xml_file)
70+
print(f"Testing AASX...")
71+
aasx_file = os.path.join(script_dir, "..", "..", "bin/check_servers/test_data/TestDataWithThumbnail.aasx")
72+
file.check_aasx_file(aasx_file)
7073
stop = time.time()
7174
print(f"Elapsed time: {stop - start:.1f}s")

0 commit comments

Comments
 (0)