Project: Testing Part 1

In the starter kit there is a self_testing.py file. When you run it you'll see a menu you can use to test different functions.

I recommend you test in order because the tests all rely on your draw_item() function.

You are welcome to change the self_testing.py file to enhance your tests. You should use (but not change) the cmpt120image.py file to load and display images.

Here is what it should look like:

  • Menu
    • The menu is printed in the console inside VS Code. It uses a special read_input_with_screen() function instead of input(), so you'll need to click into the pop-up window and then type a number and press enter.
      • When it says <Screen> on the input prompt, it means you have to type the number while clicked on the pop-up window.
    • The menu should look like:
      Which function would you like to test?
      1. draw_item(canvas, img, row, col)
      2. recolor_image(img, color)
      3. minify(img)
      4. mirror(img)
      5. distribute_items(canvas, img, n)
      6. Test different sizes
      <Screen> (Enter to exit) :
  • Draw Item
    Draw item
  • Recolour
    Recolour
  • Minify
    Minify
  • Mirror
    Mirror
  • Distribute Items
    Distribute
  • Test Different Sizes
    Different sizes