summaryrefslogtreecommitdiff
path: root/media-sound/beets/files/1.5.0-0001-Remove-test_completion.patch
blob: 16c1a6fe5fa1a7829e70e73d55f4614f25b98228 (plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
From a992bf194803d3598a8edc054a767858b0355a78 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <arsen@aarsen.me>
Date: Thu, 21 Oct 2021 23:16:45 +0200
Subject: [PATCH] Remove test_completion

Known issue: https://github.com/beetbox/beets/issues/1876
---
 test/test_ui.py | 50 -------------------------------------------------
 1 file changed, 50 deletions(-)

diff --git a/test/test_ui.py b/test/test_ui.py
index 5cfed1fd..48e7cc85 100644
--- a/test/test_ui.py
+++ b/test/test_ui.py
@@ -1209,56 +1209,6 @@ class PluginTest(_common.TestCase, TestHelper):
         self.run_command('test', lib=None)
 
 
-@_common.slow_test()
-class CompletionTest(_common.TestCase, TestHelper):
-    def test_completion(self):
-        # Load plugin commands
-        config['pluginpath'] = [_common.PLUGINPATH]
-        config['plugins'] = ['test']
-
-        # Do not load any other bash completion scripts on the system.
-        env = dict(os.environ)
-        env['BASH_COMPLETION_DIR'] = os.devnull
-        env['BASH_COMPLETION_COMPAT_DIR'] = os.devnull
-
-        # Open a `bash` process to run the tests in. We'll pipe in bash
-        # commands via stdin.
-        cmd = os.environ.get('BEETS_TEST_SHELL', '/bin/bash --norc').split()
-        if not has_program(cmd[0]):
-            self.skipTest(u'bash not available')
-        tester = subprocess.Popen(cmd, stdin=subprocess.PIPE,
-                                  stdout=subprocess.PIPE, env=env)
-
-        # Load bash_completion library.
-        for path in commands.BASH_COMPLETION_PATHS:
-            if os.path.exists(util.syspath(path)):
-                bash_completion = path
-                break
-        else:
-            self.skipTest(u'bash-completion script not found')
-        try:
-            with open(util.syspath(bash_completion), 'rb') as f:
-                tester.stdin.writelines(f)
-        except IOError:
-            self.skipTest(u'could not read bash-completion script')
-
-        # Load completion script.
-        self.io.install()
-        self.run_command('completion', lib=None)
-        completion_script = self.io.getoutput().encode('utf-8')
-        self.io.restore()
-        tester.stdin.writelines(completion_script.splitlines(True))
-
-        # Load test suite.
-        test_script_name = os.path.join(_common.RSRC, b'test_completion.sh')
-        with open(test_script_name, 'rb') as test_script_file:
-            tester.stdin.writelines(test_script_file)
-        out, err = tester.communicate()
-        if tester.returncode != 0 or out != b'completion tests passed\n':
-            print(out.decode('utf-8'))
-            self.fail(u'test/test_completion.sh did not execute properly')
-
-
 class CommonOptionsParserCliTest(unittest.TestCase, TestHelper):
     """Test CommonOptionsParser and formatting LibModel formatting on 'list'
     command.
-- 
2.32.0