Commit 7fe46819 authored by Stephen Thompson's avatar Stephen Thompson

Merge branch '89-model-loader-order'

parents 7200bae3 29fc3177
Pipeline #3777 passed with stages
in 8 minutes and 24 seconds
......@@ -69,6 +69,7 @@ class VTKSurfaceModelDirectoryLoader:
# If its not valid I want the Exception raised.
LOGGER.info("Loading models from %s", directory_name)
self.files = os.listdir(directory_name)
self.files.sort()
# Loop through each file, trying to load it.
counter = 0
......
......@@ -73,3 +73,11 @@ def test_valid_dir_with_colours_from_file_from_issue_4():
dir_name = 'tests/data/models/Liver'
loader = VTKSurfaceModelDirectoryLoader(dir_name)
assert len(loader.models) == 9
def test_consistent_model_order_issue_89():
dir_name = 'tests/data/models/Liver'
loader = VTKSurfaceModelDirectoryLoader(dir_name)
assert loader.models[0].get_name() == "arteries.vtk"
assert loader.models[3].get_name() == "gastric_vein.vtk"
assert loader.models[5].get_name() == "liver.vtk"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment