当前位置: 首页>>代码示例>>Python>>正文


Python Resolwe._process_inputs方法代码示例

本文整理汇总了Python中resdk.resolwe.Resolwe._process_inputs方法的典型用法代码示例。如果您正苦于以下问题:Python Resolwe._process_inputs方法的具体用法?Python Resolwe._process_inputs怎么用?Python Resolwe._process_inputs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在resdk.resolwe.Resolwe的用法示例。


在下文中一共展示了Resolwe._process_inputs方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_bad_inputs

# 需要导入模块: from resdk.resolwe import Resolwe [as 别名]
# 或者: from resdk.resolwe.Resolwe import _process_inputs [as 别名]
    def test_bad_inputs(self, resolwe_mock, os_mock):
        # Good file, upload fails becouse of bad input keyword
        os_mock.path.isfile.return_value = True
        process = self.process_mock

        resolwe_mock._upload_file = MagicMock(return_value=None)
        message = r'Field .* not in process .* input schema.'
        with self.assertRaisesRegex(ValidationError, message):
            Resolwe._process_inputs(resolwe_mock, {"bad_key": "/good/path/to/file"}, process)
开发者ID:genialis,项目名称:resolwe-bio-py,代码行数:11,代码来源:test_resolwe.py

示例2: test_wrap_list

# 需要导入模块: from resdk.resolwe import Resolwe [as 别名]
# 或者: from resdk.resolwe.Resolwe import _process_inputs [as 别名]
    def test_wrap_list(self, resolwe_mock):
        process = self.process_mock

        Resolwe._process_inputs(resolwe_mock, {"src_list": ["/path/to/file"]}, process)
        resolwe_mock._process_file_field.assert_called_once_with('/path/to/file')

        resolwe_mock.reset_mock()
        Resolwe._process_inputs(resolwe_mock, {"src_list": "/path/to/file"}, process)
        resolwe_mock._process_file_field.assert_called_once_with('/path/to/file')
开发者ID:genialis,项目名称:resolwe-bio-py,代码行数:11,代码来源:test_resolwe.py

示例3: test_dehydrate_data

# 需要导入模块: from resdk.resolwe import Resolwe [as 别名]
# 或者: from resdk.resolwe.Resolwe import _process_inputs [as 别名]
    def test_dehydrate_data(self, resolwe_mock):
        data_obj = Data(id=1, resolwe=MagicMock())
        data_obj.id = 1  # this is overriden when initialized
        process = self.process_mock

        result = Resolwe._process_inputs(resolwe_mock, {"genome": data_obj}, process)
        self.assertEqual(result, {'genome': 1})

        result = Resolwe._process_inputs(resolwe_mock, {"reads": [data_obj]}, process)
        self.assertEqual(result, {'reads': [1]})
开发者ID:genialis,项目名称:resolwe-bio-py,代码行数:12,代码来源:test_resolwe.py

示例4: test_dehydrate_data

# 需要导入模块: from resdk.resolwe import Resolwe [as 别名]
# 或者: from resdk.resolwe.Resolwe import _process_inputs [as 别名]
    def test_dehydrate_data(self, resolwe_mock, copy_mock):
        data_obj = Data(id=1, resolwe=MagicMock())
        data_obj.id = 1  # this is overriden when initialized
        process = self.process_mock

        # I appears it is not possible to deepcopy MagicMocks so we just patch
        # the deepcopy functionality:
        copy_mock.deepcopy = MagicMock(return_value={"genome": data_obj})
        result = Resolwe._process_inputs(resolwe_mock, {"genome": data_obj}, process)
        self.assertEqual(result, {'genome': 1})

        # I appears it is not possible to deepcopy MagicMocks so we just patch
        # the deepcopy functionality:
        copy_mock.deepcopy = MagicMock(return_value={"reads": data_obj})
        result = Resolwe._process_inputs(resolwe_mock, {"reads": [data_obj]}, process)
        self.assertEqual(result, {'reads': [1]})
开发者ID:JureZmrzlikar,项目名称:resolwe-bio-py,代码行数:18,代码来源:test_resolwe.py

示例5: test_keep_input

# 需要导入模块: from resdk.resolwe import Resolwe [as 别名]
# 或者: from resdk.resolwe.Resolwe import _process_inputs [as 别名]
    def test_keep_input(self, resolwe_mock):
        process = self.process_mock

        input_dict = {"src_list": ["/path/to/file"]}
        Resolwe._process_inputs(resolwe_mock, input_dict, process)
        self.assertEqual(input_dict, {"src_list": ["/path/to/file"]})
开发者ID:genialis,项目名称:resolwe-bio-py,代码行数:8,代码来源:test_resolwe.py


注:本文中的resdk.resolwe.Resolwe._process_inputs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。