Use a ResourceManager to find assets

This commit is contained in:
Yohann D'ANELLO
2020-11-19 02:49:59 +01:00
parent d92a5e1629
commit 00f843754a
5 changed files with 21 additions and 4 deletions

View File

@ -2,6 +2,7 @@ import unittest
from squirrelbattle.display.texturepack import TexturePack
from squirrelbattle.interfaces import Map, Tile
from squirrelbattle.resources import ResourceManager
class TestInterfaces(unittest.TestCase):
@ -18,7 +19,7 @@ class TestInterfaces(unittest.TestCase):
"""
Try to load a map from a file.
"""
m = Map.load("squirrelbattle/assets/example_map.txt")
m = Map.load(ResourceManager.get_asset_path("example_map.txt"))
self.assertEqual(m.width, 52)
self.assertEqual(m.height, 17)