Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hookutils: skip checking stat for skipped DMI files and add unit test for apport.hookutils.attach_dmi #227

Merged
merged 2 commits into from Oct 24, 2023

Conversation

bdrung
Copy link
Collaborator

@bdrung bdrung commented Oct 23, 2023

The DMI files subsystem and uevent will be always skipped. So checking their status with os.stat is not needed.

Add a unit test for apport.hookutils.attach_dmi that uses real data. This can be used as basis for fixing issues in attach_hardware (see #226).

The DMI files `subsystem` and `uevent` will be always skipped. So
checking their status with `os.stat` is not needed.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
Add a unit test for `apport.hookutils.attach_dmi` that uses real data.
This can be used as basis for fixing issues in `attach_hardware`.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
Copy link
Contributor

@Chris-Peterson444 Chris-Peterson444 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@codecov
Copy link

codecov bot commented Oct 24, 2023

Codecov Report

Merging #227 (3674252) into main (1f4a039) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #227      +/-   ##
==========================================
+ Coverage   82.81%   82.83%   +0.02%     
==========================================
  Files          91       91              
  Lines       18737    18759      +22     
==========================================
+ Hits        15517    15539      +22     
  Misses       3220     3220              
Files Coverage Δ
apport/hookutils.py 59.72% <100.00%> (ø)
tests/unit/test_hookutils.py 100.00% <100.00%> (ø)

@schopin-pro schopin-pro merged commit 0584b79 into canonical:main Oct 24, 2023
25 checks passed
@bdrung bdrung deleted the test_attach_dmi branch October 24, 2023 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants