From a992bf194803d3598a8edc054a767858b0355a78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= 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