Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Test_parse_rgb_number #8

Merged
merged 13 commits into from
Jun 17, 2024
32 changes: 26 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Running `coverage html` and opening the document in the browser gives the follow

<Provide the same kind of information provided for Function 1>

Thijmen
#### Thijmen

flatten_literal_params

Expand All @@ -52,7 +52,7 @@ flatten_literal_params

![](./assets/_human_join_custom.png)

Maurice
#### Maurice

\_string_width

Expand All @@ -66,7 +66,7 @@ escape_markdown

![](./assets/escape_markdown_custom.png)

Yasin
#### Yasin

\_get and \_aget

Expand All @@ -82,6 +82,14 @@ Note: the second commmit is the final instrumentation

![](./assets/json_or_text_custom.png)

#### Frank

parse_rgb_number

[commit](https://github.com/tthijm/sep/commit/45156c574d1be11a2da25e0f74efe866d3e2cc97)

![](./assets/parse_rgb_number_custom.png)

## Coverage improvement

### Individual tests
Expand All @@ -104,7 +112,7 @@ Note: the second commmit is the final instrumentation

<Provide the same kind of information provided for Test 1>

Thijmen
#### Thijmen

test_flatten_literal_params

Expand All @@ -128,7 +136,7 @@ test\_\_human_join
The coverage improvement is +100%.
The coverage has been improved, because `_human_join` used to not be tested, while the new `test__human_join` considers every branch to be taken.

Maurice
#### Maurice

test_escape_markdown

Expand All @@ -153,7 +161,7 @@ test_string_width
The coverage improvement is +100%.
The coverage has been improved, because `string_width` used to not be tested, while the new `string_width` considers every branch to be taken.

Yasin
#### Yasin

test_get_find

Expand All @@ -177,6 +185,18 @@ test_json_or_text
The coverage improvement is 71%.
The coverage has been improved, because the previously there was no test for json_or_text. I now added a test that considers two cases: one where the data is a json and one where the data is plain text. This way we reach two additional branches and thus the coverage improves.

#### Frank

test_from_str_failures

[commit](https://github.com/tthijm/sep/commit/51a7b35a9b4af8058cc9d513085b02306ae63a43)

![](./assets/parse_rgb_number_before.png)

![](./assets/parse_rgb_number_after.png)

The coverage of the function has improved from the original 78% to 100%, since the other two branches (1 and 3) were also covered.

### Overall

<Provide a screenshot of the old coverage results by running an existing tool (the same as you already showed above)>
Expand Down
Binary file added assets/parse_rgb_number_after.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/parse_rgb_number_before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/parse_rgb_number_custom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions tests/test_colour.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ def test_from_str(value, expected):
'rgb(30, -1, 60)',
'invalid(a, b, c)',
'rgb(',
'rgb(120%,100%,90%)',
'rgb(320,300,300)',
],
)
def test_from_str_failures(value):
Expand Down
Loading