diff options
Diffstat (limited to 'sources/shiboken6/tests/samplebinding/enum_test.py')
-rw-r--r-- | sources/shiboken6/tests/samplebinding/enum_test.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sources/shiboken6/tests/samplebinding/enum_test.py b/sources/shiboken6/tests/samplebinding/enum_test.py index e425cb6ba..10c18c3bc 100644 --- a/sources/shiboken6/tests/samplebinding/enum_test.py +++ b/sources/shiboken6/tests/samplebinding/enum_test.py @@ -3,7 +3,7 @@ # ############################################################################# ## -## Copyright (C) 2016 The Qt Company Ltd. +## Copyright (C) 2021 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of the test suite of Qt for Python. @@ -141,6 +141,19 @@ class EnumTest(unittest.TestCase): self.assertEqual(SampleNamespace.enumArgumentWithDefaultValue(), SampleNamespace.UnixTime) self.assertEqual(SampleNamespace.enumArgumentWithDefaultValue(SampleNamespace.RandomNumber), SampleNamespace.RandomNumber) + def testSignature(self): + enum = SampleNamespace.Option(1) + types = type(enum).mro() + klass = types[0] + base = types[1] + # The class has an empty signature. + self.assertEqual(klass.__signature__, None) + # The base class must be Enum + self.assertNotEqual(base.__signature__, None) + # It contains an int annotation. + param = base.__signature__.parameters["itemValue"] + self.assertEqual(param.annotation, int) + class MyEvent(Event): def __init__(self): |