Browse Source

Add asserts

Foppe Hemminga 6 năm trước cách đây
mục cha
commit
242202034b
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      main.py

+ 4 - 0
main.py

@@ -5,6 +5,8 @@ import sys
 import model
 import view
 
+import types
+
 
 if __name__ == '__main__':
     status = model.get_loot_level()
@@ -29,6 +31,8 @@ if __name__ == '__main__':
     print(old_status)
     send_message = False
     print('if old_status {} != status[1] {}'.format(old_status, status[1]))
+    assert type(old_status) is types.IntType, f"old_status {old_status} is not an integer: {type(old_status)}"
+    assert type(status[1]) is types.IntType, f"status[1] {status[1]} is not an integer: {type(status[1])}"
     if old_status != status[1]:
         write_file_next = True
         send_message = True