File: test_open_librarymanager.py

package info (click to toggle)
librepcb 1.2.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 58,488 kB
  • sloc: cpp: 267,986; python: 12,100; ansic: 6,899; xml: 234; sh: 215; makefile: 115; perl: 73
file content (34 lines) | stat: -rw-r--r-- 1,063 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Test opening the library manager
"""


def test_using_button(librepcb):
    """
    Open library manager with the button in the control panel
    """
    with librepcb.open() as app:
        app.widget('controlPanelOpenLibraryManagerButton').click()
        assert app.widget('libraryManager').properties()['visible'] is True


def test_using_menu(librepcb):
    """
    Open library manager with the menu item in the control panel
    """
    with librepcb.open() as app:
        app.action('controlPanelActionOpenLibraryManager').trigger()
        assert app.widget('libraryManager').properties()['visible'] is True


# TODO: How to emulate a click on the hyperlink in a QLabel?
# def test_using_no_libraries_warning(librepcb):
#     """
#     Open library manager with the link in the "no libraries installed" warning
#     """
#     with librepcb.open() as app:
#         label = app.widget('controlPanelWarnForNoLibrariesLabel')
#         assert app.widget('libraryManager').properties()['visible'] is True