Ubuntu Pastebin

Paste from carlolo at Tue, 17 Oct 2017 13:05:54 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
diff --git a/snapcraft/tests/test_libraries.py b/snapcraft/tests/test_libraries.py
index 12bf83a8..f7e0f0ba 100644
--- a/snapcraft/tests/test_libraries.py
+++ b/snapcraft/tests/test_libraries.py
@@ -146,3 +146,26 @@ class TestSystemLibsOnNewRelease(tests.TestCase):
 
     def test_fail_gracefully_if_system_libs_not_found(self):
         self.assertThat(libraries.get_dependencies('foo'), Equals([]))
+
+
+class TestSystemLibsOnReleasesWithNoVersionId(tests.TestCase):
+
+    def setUp(self):
+        super().setUp()
+
+        patcher = mock.patch('snapcraft.internal.common.get_os_release_info')
+        distro_mock = patcher.start()
+        distro_mock.return_value = {'VERSION_CODENAME': 'xenial',
+                                    'HOME_URL': 'http://www.ubuntu.com/',
+                                    'BUG_REPORT_URL':
+                                        'http://bugs.launchpad.net/ubuntu/',
+                                    'UBUNTU_CODENAME': 'xenial',
+                                    'ID': 'ubuntu', 'NAME': 'Ubuntu',
+                                    'ID_LIKE': 'debian',
+                                    'PRETTY_NAME': 'Ubuntu 16.04.3 LTS',
+                                    'VERSION': '16.04.3 LTS (Xenial Xerus)',
+                                    'SUPPORT_URL': 'http://help.ubuntu.com/'}
+        self.addCleanup(patcher.stop)
+
+    def test_fail_gracefully_if_no_version_id_found(self):
+        self.assertThat(libraries._get_system_libs(), Equals(frozenset(['libc.so.6'])))
Download as text