소스 검색

Add asserts

Foppe Hemminga 6 년 전
부모
커밋
242202034b
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  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