Skip to content

Commit 212de33

Browse files
fix: TestGlobalCache is corrected (#3)
* fix: bad TestGlobalCache::sm_Dict * TestGlobalCache is updated (new asserts) * TestGlobalCache is updated (exact debug checks)
1 parent c4e6273 commit 212de33

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/TestGlobalCache.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
class TestGlobalCache:
1515
sm_Guard = threading.Lock()
16-
sm_Dict: typing.Dict[str, any] = dict
16+
sm_Dict: typing.Dict[str, any] = dict()
1717

1818
# --------------------------------------------------------------------
1919
def __init__(self):
@@ -24,7 +24,8 @@ def GetOrCreateResource(globalResourceID: str, resourceFactory) -> any:
2424
assert resourceFactory is not None
2525
assert isinstance(globalResourceID, str)
2626
assert __class__.sm_Guard is not None
27-
assert isinstance(__class__.sm_Dict, dict)
27+
assert __class__.sm_Dict is not None
28+
assert type(__class__.sm_Dict) == dict # noqa: E721
2829

2930
with __class__.sm_Guard:
3031
if globalResourceID in __class__.sm_Dict.keys():
@@ -40,7 +41,8 @@ def GetOrCreateResource(globalResourceID: str, resourceFactory) -> any:
4041
# --------------------------------------------------------------------
4142
def ReleaseAllResources():
4243
assert __class__.sm_Guard is not None
43-
assert isinstance(__class__.sm_Dict, dict)
44+
assert __class__.sm_Dict is not None
45+
assert type(__class__.sm_Dict) == dict # noqa: E721
4446

4547
with __class__.sm_Guard:
4648
emptyDict: typing.Dict[str, any] = dict()

0 commit comments

Comments
 (0)