gnu: Add kafs-client
[jackhill/guix/guix.git] / gnu / packages / patches / streamlink-update-test.patch
CommitLineData
87fd7a35
EF
1https://github.com/streamlink/streamlink/commit/a3123346824ee7b9c461110f292ea6987ea9a78d.patch
2This is taken from upstream, and can be removed at the next release
3
4From c6f3994e177a42792238f2edd07ba9053c10abc9 Mon Sep 17 00:00:00 2001
5From: back-to <backto@protonmail.ch>
6Date: Sat, 21 Jul 2018 14:30:51 +0200
7Subject: [PATCH] tests.localization: use en_CA instead of en_US for
8 test_equivalent
9
10**python-iso3166** got an update which breaks the Streamlink tests.
11https://pypi.org/project/iso3166/#history
12
13**python-iso3166** and **pycountry** have now a different `name` for _the United States of America_
14
15> python-iso3166: United States of America
16https://github.com/deactivated/python-iso3166/commit/e5f8b37f18b01fcb5fa0e8130d8296fc7a7b5a9f
17
18> pycountry: United States
19https://bitbucket.org/flyingcircus/pycountry/src/5aa4bb47e33798cb631a81521b7b5b18f7d6c919/src/pycountry/databases/iso3166-1.json?at=default&fileviewer=file-view-default#iso3166-1.json-1572:1578
20
21https://www.iso.org/obp/ui/#iso:code:3166:US
22
23---
24
25use **en_CA** instead of **en_US** for backwards compatibility,
26as changing the **US** name would fail with older versions of **python-iso3166** / **pycountry**
27---
28 tests/test_localization.py | 13 +++++++------
29 1 file changed, 7 insertions(+), 6 deletions(-)
30
31diff --git a/tests/test_localization.py b/tests/test_localization.py
32index 0b81ae591..90bb3ac31 100644
33--- a/tests/test_localization.py
34+++ b/tests/test_localization.py
35@@ -32,11 +32,12 @@ def test_bad_language_code(self):
36 self.assertRaises(LookupError, l10n.Localization, "enUS")
37
38 def test_equivalent(self):
39- l = l10n.Localization("en_US")
40+ l = l10n.Localization("en_CA")
41 self.assertTrue(l.equivalent(language="eng"))
42 self.assertTrue(l.equivalent(language="en"))
43- self.assertTrue(l.equivalent(language="en", country="US"))
44- self.assertTrue(l.equivalent(language="en", country="United States"))
45+ self.assertTrue(l.equivalent(language="en", country="CA"))
46+ self.assertTrue(l.equivalent(language="en", country="CAN"))
47+ self.assertTrue(l.equivalent(language="en", country="Canada"))
48
49 def test_equivalent_remap(self):
50 l = l10n.Localization("fr_FR")
51@@ -48,7 +49,7 @@ def test_not_equivalent(self):
52 self.assertFalse(l.equivalent(language="eng"))
53 self.assertFalse(l.equivalent(language="en"))
54 self.assertFalse(l.equivalent(language="en", country="US"))
55- self.assertFalse(l.equivalent(language="en", country="United States"))
56+ self.assertFalse(l.equivalent(language="en", country="Canada"))
57 self.assertFalse(l.equivalent(language="en", country="ES"))
58 self.assertFalse(l.equivalent(language="en", country="Spain"))
59
60@@ -71,8 +72,8 @@ def test_get_country(self):
61 l10n.Localization.get_country("USA").alpha2)
62 self.assertEqual("GB",
63 l10n.Localization.get_country("GB").alpha2)
64- self.assertEqual("United States",
65- l10n.Localization.get_country("United States").name)
66+ self.assertEqual("Canada",
67+ l10n.Localization.get_country("Canada").name)
68
69 def test_get_country_miss(self):
70 self.assertRaises(LookupError, l10n.Localization.get_country, "XE")