aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-02-15 09:43:09 +0100
committerCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-02-15 09:39:00 +0000
commitcc7b6beea3e39d8a8d092465621e5674391a692d (patch)
treef28c7a93eb01ee676c634f48d013ef73d636b77f
parent45f3126a04cd5493323b689c85a48106d0f8367e (diff)
Add condition to qmimedatabase_test
An assert related to a Mimetype comment fails if the language is unset or is not English. Since this assert is not critical to the functionality of the module, we can remove it or add a simple condition to test it only when the system's language is English. The last one was applied. Task-number: PYSIDE-575 Change-Id: Ida85268e25522e406878dd6ac4e5e70852f8d8e4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r--sources/pyside2/tests/QtCore/qmimedatabase_test.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/sources/pyside2/tests/QtCore/qmimedatabase_test.py b/sources/pyside2/tests/QtCore/qmimedatabase_test.py
index 7bd9a458..4c3ae220 100644
--- a/sources/pyside2/tests/QtCore/qmimedatabase_test.py
+++ b/sources/pyside2/tests/QtCore/qmimedatabase_test.py
@@ -34,7 +34,7 @@ import unittest
import ctypes
import sys
-from PySide2.QtCore import QMimeDatabase
+from PySide2.QtCore import QMimeDatabase, QLocale
class QMimeDatabaseTest(unittest.TestCase):
def testMimeTypeForName(self):
@@ -43,7 +43,8 @@ class QMimeDatabaseTest(unittest.TestCase):
s0 = db.mimeTypeForName("application/x-zerosize")
self.assertTrue(s0.isValid())
self.assertEqual(s0.name(), "application/x-zerosize")
- self.assertEqual(s0.comment(), "empty document")
+ if "en" in QLocale().name():
+ self.assertEqual(s0.comment(), "empty document")
s0Again = db.mimeTypeForName("application/x-zerosize")
self.assertEqual(s0Again.name(), s0.name())