Research portable Memory game | Исследовать портируемую игру Память
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.2KB

  1. from gui import *
  2. from gui_TextureDescription import *
  3. from memory_Context import *
  4. def test_gui_generateTextureDescriptions(
  5. ) -> str:
  6. c = memory_createContext()
  7. c.tileImage = "res/img.png"
  8. c.tileImageCount = 3
  9. c.tileImageHeight = 35
  10. c.tileImageWidth = 20
  11. c.recentField = "tileImageWidth"
  12. c = gui_generateTextureDescriptions(c)
  13. if (
  14. c.recentField == "textureDescriptions" and
  15. len(c.textureDescriptions) == 3 and
  16. c.textureDescriptions[0].fileName == "res/img.png" and
  17. c.textureDescriptions[0].height == 35 and
  18. c.textureDescriptions[0].width == 20 and
  19. c.textureDescriptions[0].x == 0 and
  20. c.textureDescriptions[1].x == 20 and
  21. c.textureDescriptions[2].x == 40
  22. ):
  23. return "OK: gui_generateTextureDescriptions"
  24. #}
  25. return "ERR: gui_generateTextureDescriptions"
  26. #}
  27. def test_gui_generateTilePositions(
  28. ) -> str:
  29. c = memory_createContext()
  30. c.cellSize = 10
  31. c.playfieldSize = 2
  32. c.windowHeight = 200
  33. c.windowWidth = 200
  34. c.recentField = "windowWidth"
  35. c = gui_generateTilePositions(c)
  36. if (
  37. c.recentField == "tilePositions" and
  38. len(c.tilePositions) == 4 and
  39. c.tilePositions[0][0] == 140
  40. ):
  41. return "OK: gui_generateTilePositions"
  42. #}
  43. return "ERR: gui_generateTilePositions"
  44. #}