Exemplo n.º 1
0
def test_unset_organization(qapp, orgname, expected):
    """Test unset_organization.

    Args:
        orgname: The organizationName to set initially.
        expected: The organizationName which is expected when reading back.
    """
    qapp.setOrganizationName(orgname)
    assert qapp.organizationName() == expected  # sanity check
    with standarddir._unset_organization():
        assert qapp.organizationName() == ''
    assert qapp.organizationName() == expected
Exemplo n.º 2
0
def test_unset_organization(qapp, orgname, expected):
    """Test unset_organization.

    Args:
        orgname: The organizationName to set initially.
        expected: The organizationName which is expected when reading back.
    """
    qapp.setOrganizationName(orgname)
    assert qapp.organizationName() == expected  # sanity check
    with standarddir._unset_organization():
        assert qapp.organizationName() == ''
    assert qapp.organizationName() == expected
Exemplo n.º 3
0
def test_unset_organization_no_qapp(monkeypatch):
    """Without a QApplication, _unset_organization should do nothing."""
    monkeypatch.setattr(standarddir.QApplication, 'instance', lambda: None)
    with standarddir._unset_organization():
        pass
Exemplo n.º 4
0
def test_unset_organization_no_qapp(monkeypatch):
    """Without a QApplication, _unset_organization should do nothing."""
    monkeypatch.setattr(standarddir.QApplication, 'instance', lambda: None)
    with standarddir._unset_organization():
        pass