[pitivi/1.0] tests: Set local to en_US as this is what is expected
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi/1.0] tests: Set local to en_US as this is what is expected
- Date: Wed, 1 May 2019 01:50:17 +0000 (UTC)
commit ab0d49a4297456dbd56fe40be6338a8611738dd8
Author: Thibault Saunier <tsaunier igalia com>
Date: Sun Feb 17 23:22:41 2019 -0300
tests: Set local to en_US as this is what is expected
tests/common.py | 2 ++
tests/test_utils.py | 15 ++++++++-------
2 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/tests/common.py b/tests/common.py
index 1dc290c4..1524c653 100644
--- a/tests/common.py
+++ b/tests/common.py
@@ -21,6 +21,7 @@ A collection of objects to use for testing
"""
import contextlib
import gc
+import locale
import os
import shutil
import sys
@@ -70,6 +71,7 @@ for category in ["GStreamer", "Gtk", "Gdk", "GLib-GObject", "GES"]:
detect_leaks = os.environ.get("PITIVI_TEST_DETECT_LEAKS", "0") not in ("0", "")
os.environ["PITIVI_USER_CACHE_DIR"] = tempfile.mkdtemp(suffix="pitiviTestsuite")
+locale.setlocale(locale.LC_ALL, "en_US")
def __create_settings(proxyingStrategy=ProxyingStrategy.NOTHING,
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 97a029cc..08e2d45a 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -17,7 +17,6 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-from unittest import TestCase
from unittest.mock import Mock
from gi.repository import GLib
@@ -33,13 +32,15 @@ from pitivi.utils.ui import beautify_length
from pitivi.utils.ui import format_audiochannels
from pitivi.utils.ui import format_audiorate
from pitivi.utils.ui import format_framerate_value
+from tests import common
second = Gst.SECOND
minute = second * 60
hour = minute * 60
-class TestBeautifyLength(TestCase):
+class TestBeautifyTime(common.TestCase):
+ """Tests time beautifying utility methods."""
def test_beautify_seconds(self):
self.assertEqual(beautify_length(second), "1 second")
@@ -65,7 +66,7 @@ class TestBeautifyLength(TestCase):
self.assertEqual(beautify_length(Gst.CLOCK_TIME_NONE), "")
-class TestFormatFramerateValue(TestCase):
+class TestFormatFramerateValue(common.TestCase):
def __check(self, num, denom, expected):
stream = Mock(spec=GstPbutils.DiscovererVideoInfo)
@@ -96,7 +97,7 @@ class TestFormatFramerateValue(TestCase):
self.__check(120, 1, "120")
-class TestFormatAudiorate(TestCase):
+class TestFormatAudiorate(common.TestCase):
def __check(self, rate, expected):
stream = Mock(spec=GstPbutils.DiscovererAudioInfo)
@@ -114,7 +115,7 @@ class TestFormatAudiorate(TestCase):
self.__check(960000, "960 kHz")
-class TestFormatAudiochannels(TestCase):
+class TestFormatAudiochannels(common.TestCase):
def __check(self, channels, expected):
stream = Mock(spec=GstPbutils.DiscovererAudioInfo)
@@ -129,7 +130,7 @@ class TestFormatAudiochannels(TestCase):
self.__check(6, "6 (5.1)")
-class TestDependencyChecks(TestCase):
+class TestDependencyChecks(common.TestCase):
def testDependencies(self):
gi_dep = GstDependency("Gst", "1.0", "1.0.0")
@@ -165,7 +166,7 @@ class TestDependencyChecks(TestCase):
self.assertTrue(classic_dep.satisfied)
-class TestMiscUtils(TestCase):
+class TestMiscUtils(common.TestCase):
def test_fixate_caps_with_defalt_values(self):
voaacenc_caps = Gst.Caps.from_string(
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]