report drafting

This commit is contained in:
Deekshu Kare 2024-06-27 01:31:51 +02:00
parent aad549687a
commit ef83eaf4c3
4 changed files with 25 additions and 35 deletions

View File

@ -54,6 +54,14 @@ the shared code in **conftest.py**.
**1. Deekshu** **1. Deekshu**
- Function 1: `buildTransform()` from **ImageCms.py**
[Link to the commit](https://github.com/python-pillow/Pillow/commit/e31adc7e40442076f65a47b457f0c73040d4e7fc#diff-bd1e1b1de6e5b72a2a01d9d5ea74efe89541f209db5b30c16b975af71e308c67)
- Function 2: `encode_to_file` from **ImageFile.py**
[Link to the commit](https://github.com/python-pillow/Pillow/commit/4f31cd7a31a6be2ac38773bab6f0a5451480f5b8#diff-4668a28f508bbcb68e61f9b257415dc814c22e8bb24850629fe7788ae5b7475c)
**2. Duru** **2. Duru**
**3. Isidora** **3. Isidora**
@ -96,6 +104,22 @@ the shared code in **conftest.py**.
**1. Deekshu** **1. Deekshu**
- Function 1: `buildTransform()` from **ImageCms.py**
[Link to the commit](https://github.com/jovanovicisidora/Pillow-SEP/commit/aad549687a1cf9528453eec5e9344192dce388e1)
<img src="report_images/deekshu_images/[AFTER]buildTransform.png" alt="Coverage Before" width="600" />
<img src="report_images/deekshu_images/[AFTER]buildTransform.png" alt="Coverage After" width="600" />
- Function 2: `encode_to_file` from **ImageFile.py**
[Link to the commit]() - how to show the diff patch
<img src="report_images/deekshu_images/[AFTER]encode_to_file.png" alt="Coverage Before" width="600" />
<img src="report_images/deekshu_images/[AFTER]encode_to_file.png" alt="Coverage After" width="600" />
**2. Duru** **2. Duru**
**3. Isidora** **3. Isidora**
@ -132,5 +156,5 @@ Here we show the improved overall coverage with all test modifications made by o
Each group member had an equal contribution to the assignment. We first met together to determine Each group member had an equal contribution to the assignment. We first met together to determine
how we can make a coverage tool that can be used across all functions (in conftest.py). Then, each how we can make a coverage tool that can be used across all functions (in conftest.py). Then, each
member chose two functions to instrument our coverage tool on and to make/enhance tests for them. member chose two functions to instrument our coverage tool on and to make/enhance tests for their branch improvement.
The specific functions each member chose can be seen in the report above. The specific functions each member chose can be seen in the report above.

View File

@ -698,37 +698,3 @@ def test_deprecation() -> None:
assert ImageCms.VERSION == "1.0.0 pil" assert ImageCms.VERSION == "1.0.0 pil"
with pytest.warns(DeprecationWarning): with pytest.warns(DeprecationWarning):
assert isinstance(ImageCms.FLAGS, dict) assert isinstance(ImageCms.FLAGS, dict)
def test_buildTransform_flags_non_integer():
with pytest.raises(ImageCms.PyCMSError):
ImageCms.buildTransform(
inputProfile="path/to/input/profile",
outputProfile="path/to/output/profile",
inMode="RGB",
outMode="CMYK",
renderingIntent=ImageCms.Intent.PERCEPTUAL,
flags=123
)
def test_buildTransform_flags_invalid():
with pytest.raises(ImageCms.PyCMSError):
ImageCms.buildTransform(
inputProfile="path/to/input/profile",
outputProfile="path/to/output/profile",
inMode="RGB",
outMode="CMYK",
renderingIntent=ImageCms.Intent.PERCEPTUAL,
flags=999999
)
def test_rendering_intent_non_integer():
with pytest.raises(ImageCms.PyCMSError) as exc_info:
ImageCms.buildTransform(
inputProfile="path/to/input/profile",
outputProfile="path/to/output/profile",
inMode="RGB",
outMode="CMYK",
renderingIntent="not an integer",
flags=0
)
assert str(exc_info.value) == "renderingIntent must be an integer between 0 and 3"

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB