Files
modelscope/tests/cli/test_plugins_cmd.py
mulin.lyh eb0f0216c6 fix torch 2.x compatible issue
Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/13045011

* fix torch 2.x compatible issue

* fix torch 2.x compatible issue

* fix complex-valued input tensor matching the output from stft with return_complex=True.

* skip plugin test temporarily for modify torch version

* fix test_speech_signal_process.py compatible issue

* fix lint issue

* upgrade funasr to 0.6.5
2023-06-27 14:40:51 +08:00

52 lines
1.7 KiB
Python

import subprocess
import unittest
from modelscope.utils.plugins import PluginsManager
@unittest.skipUnless(False, reason='For it modify torch version')
class PluginsCMDTest(unittest.TestCase):
def setUp(self):
print(('Testing %s.%s' % (type(self).__name__, self._testMethodName)))
self.package = 'adaseq'
self.plugins_manager = PluginsManager()
def tearDown(self):
super().tearDown()
def test_plugins_install(self):
cmd = f'python -m modelscope.cli.cli plugin install {self.package}'
stat, output = subprocess.getstatusoutput(cmd)
self.assertEqual(stat, 0)
# move this from tear down to avoid unexpected uninstall
uninstall_args = [self.package, '-y']
self.plugins_manager.uninstall_plugins(uninstall_args)
def test_plugins_uninstall(self):
# move this from tear down to avoid unexpected uninstall
uninstall_args = [self.package, '-y']
self.plugins_manager.uninstall_plugins(uninstall_args)
cmd = f'python -m modelscope.cli.cli plugin install {self.package}'
stat, output = subprocess.getstatusoutput(cmd)
self.assertEqual(stat, 0)
cmd = f'python -m modelscope.cli.cli plugin uninstall {self.package}'
stat, output = subprocess.getstatusoutput(cmd)
self.assertEqual(stat, 0)
# move this from tear down to avoid unexpected uninstall
uninstall_args = [self.package, '-y']
self.plugins_manager.uninstall_plugins(uninstall_args)
def test_plugins_list(self):
cmd = 'python -m modelscope.cli.cli plugin list'
stat, output = subprocess.getstatusoutput(cmd)
self.assertEqual(stat, 0)
if __name__ == '__main__':
unittest.main()