Skip to content

Commit

Permalink
Fix bad check in _checkItemAttributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Jul 11, 2023
1 parent 62a7a29 commit c756342
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions win32/test/test_win32wnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,20 @@ def testGetUser(self):
def _checkItemAttributes(self, item, attrs):
for attr, typ in attrs:
val = getattr(item, attr)
if typ is None:
new_val = "new value"
elif typ is int:
if typ is int:
self.assertTrue(
isinstance(val, int), "Attr %r has value %r" % (attr, val)
)
new_val = val + 1
elif typ is str:
self.assertTrue(
isinstance(val, str), "Attr %r has value %r" % (attr, val)
)
new_val = val + " new value"
if val is not None:
# must be string
self.assertTrue(
isinstance(val, str), "Attr %r has value %r" % (attr, val)
)
new_val = val + " new value"
else:
new_val = "new value"
else:
self.fail("Don't know what %s is" % (typ,))
# set the attribute just to make sure we can.
Expand Down

0 comments on commit c756342

Please sign in to comment.