MCPcopy Create free account
hub / github.com/Cantera/cantera / check

Method check

test/python/test_composite.py:353–377  ·  view source on GitHub ↗
(self, arr, repr, rows)

Source from the content-addressed store, hash-verified

351 width = 80
352
353 def check(self, arr, repr, rows):
354 count = 0
355 width = None
356 header = None
357 for line in repr.split("\n"):
358 if not len(line):
359 break
360 if width is None:
361 width = len(line)
362 assert width <= self.width
363 header = line.split()
364 else:
365 assert width == len(line)
366 count += 1
367
368 if rows is not None:
369 assert count == rows + 1 # account for header
370
371 names = arr.component_names
372 if "..." not in header:
373 assert len(header) == len(names)
374 else:
375 assert len(header) > 1
376 header = {key for key in header if key != "..."}
377 assert not header.difference(names)
378
379 def test_short(self):
380 arr = ct.SolutionArray(self.gas, 5)

Callers 13

test_shortMethod · 0.95
test_longMethod · 0.95
test_scientificMethod · 0.95
test_plus_minus_iMethod · 0.95
test_plus_minus_fMethod · 0.95
test_plus_minus_eMethod · 0.95
test_stringsMethod · 0.95
test_double_vectorMethod · 0.95
test_integer_vectorMethod · 0.95
test_string_vectorMethod · 0.95
test_select_rowsMethod · 0.95
test_water_simpleMethod · 0.95

Calls 2

lenFunction · 0.85
splitMethod · 0.80

Tested by

no test coverage detected