ceedee666 / opensap_python_intro

This repository contains several Jupyter notebooks. These notebooks are the course material for an upcoming openSAP course on Python 🐍.
Creative Commons Zero v1.0 Universal
5 stars 1 forks source link

More detailed check for open r/w #117

Closed Hiltiprant closed 2 years ago

Hiltiprant commented 2 years ago

For exercise 4-5 (#116) I used a more detailed test to check if open was used in read- or write-mode:

https://github.com/ceedee666/opensap_python_intro/blob/a8cdfa8d57ebaa64c0037c276513fd6f74550f2f/exercises/week_4/4.5/structural_tests.py#L22-L27

In 4-4, I justed checked if there was the ast.Constant r/w within a with structure (as proposed). Should I add this to 4-4, too @ceedee666 ?

ceedee666 commented 2 years ago

yes, pleas also use this check in 4-4.

Hiltiprant commented 2 years ago

@ceedee666 I updated the tests for 4-4 to use this structure and also updated in CO. I did not change the tests for 4-3 (they only check for an open statement w/o checking the mode). I think it is fine to make the tests for the first exercise of the week a little less strict and have more detailed checks in the next exercises (e.g. 4-4 & 4-5)