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

More mock stuff #324

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

More mock stuff #324

wants to merge 1 commit into from

Conversation

DemiMarie
Copy link
Contributor

Menu needs this.

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.24%. Comparing base (ab72538) to head (5f8a5c6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #324      +/-   ##
==========================================
- Coverage   75.26%   75.24%   -0.03%     
==========================================
  Files          52       52              
  Lines        8950     8950              
==========================================
- Hits         6736     6734       -2     
- Misses       2214     2216       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

qubesadmin/tests/mock_app.py Outdated Show resolved Hide resolved
Menu needs this.
Comment on lines +651 to +656
self._qubes['test-vm2'] = MockQube(name="test-vm2", qapp=self,
features={'menu-favorites': ''})
self._qubes['dom0'].features['menu-initial-page'] = 'favorites_page'
self._qubes['dom0'].features['menu-sort-running'] = '1'
self._qubes['dom0'].features['menu-position'] = 'mouse'

Copy link
Member

@marmarek marmarek Dec 14, 2024

Choose a reason for hiding this comment

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

I'm not against it here, but wouldn't it be more convenient to have it in desktop-linux-menu, in a wrapper?
Simply add a file somewhere in tests/ directory that does:

def main():
    """
    Start the menu app
    """
    # if X is not running or other weird stuff is happening, exit with exit code
    # 6 to signal to the service that this should not be restarted
    if not Gtk.init_check()[0]:
        sys.exit(6)

    qapp = qubesadmin.tests.mock_app.MockQubesComplete()
    qapp._qubes['test-vm2'] = MockQube(name="test-vm2", qapp=qapp,
                                       features={'menu-favorites': ''})
    qapp._qubes['dom0'].features['menu-initial-page'] = 'favorites_page'
    qapp._qubes['dom0'].features['menu-sort-running'] = '1'
    qapp._qubes['dom0'].features['menu-position'] = 'mouse'
    qapp.update_vm_calls()
    dispatcher = qubesadmin.tests.mock_app.MockDispatcher(qapp)
    app = AppMenu(qapp, dispatcher)
    app.run(sys.argv)


if __name__ == '__main__':
    sys.exit(main())

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