[pitivi] 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] tests: Set local to en_US as this is what is expected
- Date: Mon, 18 Feb 2019 02:41:54 +0000 (UTC)
commit 23ceaaa1322d45a742ceee783129d6d70638511c
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 | 14 +++++++-------
2 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/tests/common.py b/tests/common.py
index 68638fce..7f170413 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
@@ -73,6 +74,7 @@ for category in ["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 c53a0a3f..fedd43c7 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -18,7 +18,6 @@
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
import time
-from unittest import TestCase
from unittest.mock import Mock
from gi.repository import GLib
@@ -35,13 +34,14 @@ 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 TestBeautifyTime(TestCase):
+class TestBeautifyTime(common.TestCase):
"""Tests time beautifying utility methods."""
def __check_beautify_last_updated_timestamp(self, seconds, expected):
@@ -91,7 +91,7 @@ class TestBeautifyTime(TestCase):
self.__check_beautify_last_updated_timestamp(60 * 60 * 24 * 365 * 3, "About 3 years ago")
-class TestFormatFramerateValue(TestCase):
+class TestFormatFramerateValue(common.TestCase):
def __check(self, num, denom, expected):
stream = Mock(spec=GstPbutils.DiscovererVideoInfo)
@@ -122,7 +122,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)
@@ -140,7 +140,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)
@@ -155,7 +155,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")
@@ -191,7 +191,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]