Extract test_no_metaobj to separate module

This commit is contained in:
Raphael Pierzina 2015-04-03 10:39:01 +02:00
parent 7e51addeb0
commit 64b1b48be6
2 changed files with 30 additions and 9 deletions

View File

@ -35,15 +35,6 @@ class QEnumKeyTests(unittest.TestCase):
"""Tests for qenum_key."""
def test_no_metaobj(self):
"""Test with an enum with no meta-object."""
with self.assertRaises(AttributeError):
# Make sure it doesn't have a meta object
# pylint: disable=pointless-statement,no-member
QStyle.PrimitiveElement.staticMetaObject
key = debug.qenum_key(QStyle, QStyle.PE_PanelButtonCommand)
self.assertEqual(key, 'PE_PanelButtonCommand')
def test_metaobj(self):
"""Test with an enum with meta-object."""
# pylint: disable=pointless-statement

View File

@ -0,0 +1,30 @@
# Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# qutebrowser is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
"""Tests for qutebrowser.utils.debug."""
def test_no_metaobj(self):
"""Test with an enum with no meta-object."""
with self.assertRaises(AttributeError):
# Make sure it doesn't have a meta object
# pylint: disable=pointless-statement,no-member
QStyle.PrimitiveElement.staticMetaObject
key = debug.qenum_key(QStyle, QStyle.PE_PanelButtonCommand)
self.assertEqual(key, 'PE_PanelButtonCommand')