コード例 #1
0
 def test_download(self):
     # with pytest.raises(FileNotFoundError) as excinfo:
     # 	report.dispatch('download', \
     # 					['--zip_url', 'https://github.com/thu-coai/cotk-test-CVAE/archive/no_output.zip'])
     # assert "New result file not found." == str(excinfo.value)
     dispatch(
         'download',
         ['https://github.com/thu-coai/cotk-test-CVAE/tree/run_and_test'])
コード例 #2
0
    def test_import_local_resources(self):
        shutil.copyfile('./tests/_utils/dummy_coai/test.json',
                        './cotk/resource_config/test.json')

        dispatch('import',
                 ['resources://test', './tests/_utils/data/test.zip'])

        os.remove('./cotk/resource_config/test.json')
コード例 #3
0
ファイル: test_scripts.py プロジェクト: xiaoanshi/cotk
    def test_config(self):
        assert config.config_load("test_variable") is None

        main.dispatch('config', ["set", 'test_variable', "123"])
        main.dispatch('config', ["show", 'test_variable'])
        assert config.config_load("test_variable") == "123"

        main.dispatch('config', ["set", 'test_variable', "123", "456"])
        main.dispatch('config', ["show", 'test_variable'])
        assert config.config_load("test_variable") == "123 456"
コード例 #4
0
 def test_config(self):
     dispatch('config', ["set", 'token', "123"])
コード例 #5
0
 def test_download_error(self, url, error, match):
     with pytest.raises(error, match=match):
         dispatch('download', [url])
コード例 #6
0
ファイル: test_scripts.py プロジェクト: xiaoanshi/cotk
 def test_unknown_dispatch(self):
     main.dispatch('unknown', [])
コード例 #7
0
ファイル: test_scripts.py プロジェクト: xiaoanshi/cotk
 def test_import_local_resources(self):
     shutil.copyfile('./tests/file_utils/dummy_coai/test.json',
                     CONFIG_DIR + '/test.json')
     main.dispatch('import',
                   ['resources://test', './tests/file_utils/data/test.zip'])