Skip to content

Commit

Permalink
Added asset loading test for sub-folders
Browse files Browse the repository at this point in the history
  • Loading branch information
qcapen committed Apr 10, 2017
1 parent 852b7a0 commit 80d4eee
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,38 +28,38 @@ image_pools:
group1:
load: preload
images:
image1
image2
image3
- image1
- image2
- image3
type: random
group2:
load: preload
images:
image1
image2
image3|2
- image1
- image2
- image3|2
type: random
group3:
images:
image1
image2
image3
- image1
- image2
- image3
type: sequence
group4:
images:
image1|4
image2|2
image3
- image1|4
- image2|2
- image3
type: sequence
group5:
images:
image1|1
image2|5
image3|1
- image1|1
- image2|5
- image3|1
type: random_force_next
group6:
images:
image1
image2
image3
- image1
- image2
- image3
type: random_force_all
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions mpfmc/tests/test_Assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ def test_machine_wide_asset_loading(self):
# test images from subfolder not listed in assets:images
self.assertIn('image11', self.mc.images) # /images/custom1

# test subfolder under another subfolder listed in assets:images
self.assertIn('image14', self.mc.images) # /images/preload/subfolder

# test images from the images: section that have names configured to be
# different from their file names
self.assertIn('image_12_new_name', self.mc.images) # image12.png
Expand All @@ -47,6 +50,8 @@ def test_machine_wide_asset_loading(self):
# asset was in
self.assertEqual(self.mc.images['image4'].config['test_key'],
'test_value')
self.assertEqual(self.mc.images['image14'].config['test_key'],
'test_value')

# test custom k/v pair from asset entry in the images: section
self.assertEqual(self.mc.images['image3'].config['test_key'],
Expand Down

0 comments on commit 80d4eee

Please sign in to comment.