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

Replace bin in easy tests #1248

Merged
merged 6 commits into from
Aug 7, 2024
Merged

Conversation

i12momal
Copy link
Contributor

Also, creating mock files to improve code cleanup of files.

Copy link
Member

@danigm danigm left a comment

Choose a reason for hiding this comment

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

The test files should go to test/files folder. we don't need the full directory structure for tests.

The content path usage in the test is not right. Looks like these tests are working, even with these packages that are not exactly the same as what were trying to mock, but that could be because the tests are not checking a lot of things.

Copy link
Member

Choose a reason for hiding this comment

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

These files should go to test/files folder.


APPDATA = get_tested_mock_package(
files={
'/usr/share/appdata/broken.appdata.xml': {'content_path': '/usr/share/appdata/broken.appdata.xml'},
Copy link
Member

Choose a reason for hiding this comment

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

The correct path to use after move files to test/files will be:

'/usr/share/appdata/broken.appdata.xml': {'content-path': 'files/broken.appdata.xml'},

And the correct key is content-path not content_path, that's why even with the full system path this is working.

@i12momal i12momal changed the title Replace bin in tests.py Replace bin in easy tests Jul 19, 2024
i12momal and others added 6 commits August 7, 2024 17:49
Also, creating a mock file to improve code cleanup of the test_appdata.py file
The files are placed in the test/files directory
Also, creating a mock file to improve code cleanup of the test_dbus_policy.py file
Also, creating a mock file to improve code cleanup of the test_build_root.py file.

As for pkg: Move read_with_mmap method to AbstractPkg
This method is needed for test_build_root so to be able to use FakePkg here we need this method implemented in both classes Pkg and FakePkg
Also, creating a mock file to improve code cleanup of the test_mixed_ownership.py file. Some necessary changes are made to the pkg.py file.
@danigm danigm merged commit de9b4d2 into rpm-software-management:main Aug 7, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants