• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python test_utils.assert_str函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中test_utils.assert_str函数的典型用法代码示例。如果您正苦于以下问题:Python assert_str函数的具体用法?Python assert_str怎么用?Python assert_str使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: assert_doc_updates

def assert_doc_updates(doc):
    """Asserts a document after being updated.

    :param object doc: Document being tested.

    """
    tu.assert_str(doc.long_name, "X")
开发者ID:NCPP,项目名称:esdoc-py-client,代码行数:7,代码来源:test_type_cim_v1_software_model_component_1.py


示例2: assert_doc_updates

def assert_doc_updates(doc):
    """Asserts a document after being updated.

    :param object doc: Document being tested.

    """
    tu.assert_str(doc.description, "X")
开发者ID:ES-DOC,项目名称:esdoc-py-client,代码行数:7,代码来源:test_type_cim_v1_activity_ensemble_1.py


示例3: _test_set_option_01

def _test_set_option_01():
    """Test setting package options - positive."""
    api_url = 'http://es-doc.org'
    api_url_old = pyesdoc.get_option('api_url')
    pyesdoc.set_option('api_url', api_url)
    tu.assert_str(api_url, pyesdoc.get_option('api_url'))
    pyesdoc.set_option('api_url', api_url_old)
开发者ID:NCPP,项目名称:esdoc-py-client,代码行数:7,代码来源:test_general.py


示例4: _assert_doc_content

def _assert_doc_content(doc, is_update):
    """Assert content information."""
    tu.assert_iter(doc.content, 1, cim.v1.DataContent)
    c = doc.content[0]
    tu.assert_object(c.topic, cim.v1.DataTopic)
    tu.assert_str(c.topic.description, "missing CF name: tendency_of", True)
    tu.assert_str(c.topic.name, "fossil_fuel_organic_carbon")
开发者ID:NCPP,项目名称:esdoc-py-client,代码行数:7,代码来源:test_type_cim_v1_data_data_object_1.py


示例5: _test_create_02

def _test_create_02():
    """Test creating documents - 2."""
    for ontology, version, package, typeof in pyesdoc.list_types():
        doc = _create_doc(ontology, version, package, typeof)
        _assert_doc(doc)
        type_key = "{0}.{1}.{2}.{3}".format(ontology, version, package, typeof)
        tu.assert_str(doc.__class__.type_key, type_key)
开发者ID:NCPP,项目名称:esdoc-py-client,代码行数:7,代码来源:test_factory.py


示例6: _assert_doc_hierarchy_level

def _assert_doc_hierarchy_level(doc, is_update):
    """Assert hierarchy level information."""
    tu.assert_object(doc.hierarchy_level, cim.v1.DataHierarchyLevel)
    h = doc.hierarchy_level
    tu.assert_bool(h.is_open, True)
    tu.assert_str(h.name, "experiment")
    tu.assert_str(h.value, "HADGEM2_20C3M_1_D0_hus700")
开发者ID:NCPP,项目名称:esdoc-py-client,代码行数:7,代码来源:test_type_cim_v1_data_data_object_2.py


示例7: _assert_doc_core

def _assert_doc_core(doc, is_update):
    """Assert core information."""
    tu.assert_str(doc.description, "AMIP (1979 - at least 2008)", True)
    tu.assert_str(doc.experiment_id, "3.3")
    tu.assert_str(doc.long_name, "AMIP")
    tu.assert_iter(doc.rationales, 1, str)
    tu.assert_str(doc.rationales[0], "AMIP. Baseline simulation for", True)
    tu.assert_str(doc.short_name, "amip")
开发者ID:ES-DOC,项目名称:esdoc-py-client,代码行数:8,代码来源:test_type_cim_v1_activity_numerical_experiment.py


示例8: _assert_doc_tile_zcoords

def _assert_doc_tile_zcoords(doc, is_update):
    """Assert tile zcoords information."""
    t = doc.esm_model_grids[0].tiles[0]
    tu.assert_object(t.zcoords, cim.v1.VerticalCoordinateList)
    z = t.zcoords
    tu.assert_str(z.form, "hybrid height")
    tu.assert_str(z.type, "hybrid")
    tu.assert_iter(z.properties, 1, cim.v1.GridProperty)
开发者ID:NCPP,项目名称:esdoc-py-client,代码行数:8,代码来源:test_type_cim_v1_grids_gridspec.py


示例9: _test

def _test(mod):
    """Performs standard document extensions tests,"""
    doc = tu.get_doc(mod)    # Note - returns an extended document
    tu.assert_object(doc.ext)
    tu.assert_str(doc.type_key, doc.meta.type)
    tu.assert_str(doc.type_key, doc.ext.type)
    if hasattr(mod, "assert_doc_extensions"):
        mod.assert_doc_extensions(doc)
开发者ID:ES-DOC,项目名称:esdoc-py-client,代码行数:8,代码来源:test_extensions.py


示例10: _assert_doc_core

def _assert_doc_core(doc, is_update):
    """Assert core information."""
    tu.assert_iter(doc.reports, 1)
    r = doc.reports[0]
    tu.assert_date(r.date, '2011-05-01 12:00:00')
    tu.assert_object(r.evaluator, cim.v1.ResponsibleParty)
    tu.assert_str(r.evaluator.individual_name, '[email protected]')
    tu.assert_str(r.evaluator.role, 'pointofContact')
开发者ID:NCPP,项目名称:esdoc-py-client,代码行数:8,代码来源:test_type_cim_v1_quality_cim_quality.py


示例11: _assert_doc_core

def _assert_doc_core(doc, is_update):
    """Assert core information."""
    tu.assert_str(doc.long_name, "Machine IBM Power 6 and compiler Other")
    tu.assert_str(doc.short_name, "IBM Power 6_Other")
    tu.assert_iter(doc.contacts, 1, cim.v1.ResponsibleParty)
    tu.assert_str(doc.contacts[0].abbreviation, "MOHC")
    tu.assert_str(doc.contacts[0].organisation_name, "UK Met Office Hadley Centre")
    tu.assert_str(doc.contacts[0].role, "contact")
    tu.assert_iter(doc.units, 1, cim.v1.MachineCompilerUnit)
开发者ID:NCPP,项目名称:esdoc-py-client,代码行数:9,代码来源:test_type_cim_v1_shared_platform.py


示例12: _assert_doc_tile_vertical_resolution

def _assert_doc_tile_vertical_resolution(doc, is_update):
    """Assert tile vertical resolution."""
    t = doc.esm_model_grids[0].tiles[0]
    tu.assert_object(t.vertical_resolution, cim.v1.GridTileResolutionType)
    vr = t.vertical_resolution
    tu.assert_iter(vr.properties, 4, cim.v1.GridProperty)
    p = vr.properties[0]
    tu.assert_str(p.name, "TopModelLevel")
    tu.assert_str(p.value, "39254.8")
开发者ID:NCPP,项目名称:esdoc-py-client,代码行数:9,代码来源:test_type_cim_v1_grids_gridspec.py


示例13: _assert_doc_core

def _assert_doc_core(doc, is_update):
    """Assert core information."""
    tu.assert_str(doc.acronym, "fossil_fuel_organic_carbon")
    tu.assert_str(doc.data_status, "complete")
    tu.assert_str(doc.description, "2D gridded monthly-mean", True)
    tu.assert_iter(doc.storage, 1)
    storage = doc.storage[0]
    tu.assert_object(storage, cim.v1.DataStorageIp)
    tu.assert_str(storage.format, "ASCII")
    tu.assert_str(storage.file_name, "emissions of organic", True)
开发者ID:ES-DOC,项目名称:esdoc-py-client,代码行数:10,代码来源:test_type_cim_v1_data_data_object_1.py


示例14: _assert_doc

def _assert_doc(doc, typeof=None):
    """Perform standard test document assertions."""
    tu.assert_object(doc, typeof)
    if hasattr(doc, "meta"):
        tu.assert_str(doc.meta.institute, _INSTITUTE.lower())
        tu.assert_str(doc.meta.language, pyesdoc.ESDOC_DEFAULT_LANGUAGE)
        tu.assert_str(doc.meta.project, _PROJECT.lower())
        tu.assert_str(doc.meta.source, _INSTITUTE.lower())
        if typeof is not None:
            tu.assert_str(doc.meta.type, typeof.type_key)
开发者ID:NCPP,项目名称:esdoc-py-client,代码行数:10,代码来源:test_factory.py


示例15: _assert_doc_core

def _assert_doc_core(doc, is_update):
    """Assert core information."""
    tu.assert_str(doc.description, "The HadGEM2-A model", True)
    if not is_update:
        tu.assert_str(doc.long_name, "Hadley Global Environment Model 2 - Atmosphere")
    tu.assert_date(doc.release_date, "2009")
    tu.assert_str(doc.short_name, "HadGEM2-A")
    tu.assert_str(doc.type, "model")
    tu.assert_int(doc.types, 2)
    tu.assert_str(doc.types[1], "model")
开发者ID:NCPP,项目名称:esdoc-py-client,代码行数:10,代码来源:test_type_cim_v1_software_model_component_1.py


示例16: _test

def _test(mod, doc, encoding):
    """Perform encoding specific serialization tests."""
    # Encode/decode and re-assert document.
    as_repr = tu.encode(doc, encoding)
    as_doc_1 = tu.decode(as_repr, encoding)
    tu.assert_doc(mod, as_doc_1)

    # Re-encode and assert encodings.
    as_repr_1 = tu.encode(as_doc_1, encoding)
    tu.assert_int(len(as_repr), len(as_repr_1))
    tu.assert_str(as_repr, as_repr_1)
开发者ID:NCPP,项目名称:esdoc-py-client,代码行数:11,代码来源:test_serialization.py


示例17: assert_extension_info

def assert_extension_info(ext):
    """Asserts a document's extension information.

    :param object ext: Document extension information.

    """
    tu.assert_str(ext.display_name, "amip")
    tu.assert_str(ext.description, "Main amip ensemble simulations", True)
    tu.assert_str(ext.full_display_name, "CMIP5 Simulation : MOHC - amip")
    tu.assert_int(ext.summary_fields, 2)
    tu.assert_str(ext.summary_fields[0], "amip")
    tu.assert_str(ext.summary_fields[1], "3.3 AMIP and AMIP Ensemble", True)
开发者ID:ES-DOC,项目名称:esdoc-py-client,代码行数:12,代码来源:test_type_cim_v1_activity_simulation_run.py


示例18: assert_extension_info

def assert_extension_info(ext):
    """Asserts a document's extension information.

    :param object ext: Document extension information.

    """
    tu.assert_str(ext.display_name, "amip")
    tu.assert_str(ext.description, "AMIP (1979 - at least 2008)", True)
    tu.assert_str(ext.full_display_name, "CMIP5 Experiment : MOHC - amip")
    tu.assert_int(ext.summary_fields, 2)
    tu.assert_str(ext.summary_fields[0], "amip")
    tu.assert_str(ext.summary_fields[1], "AMIP")
开发者ID:ES-DOC,项目名称:esdoc-py-client,代码行数:12,代码来源:test_type_cim_v1_activity_numerical_experiment.py


示例19: assert_extension_info

def assert_extension_info(ext):
    """Asserts a document's extension information.

    :param object ext: Document extension information.

    """
    tu.assert_str(ext.display_name, "CMIP5 Quality Control Data Level 2")
    tu.assert_str(ext.description, "CMIP5 Quality Control", True)
    tu.assert_str(ext.full_display_name, "CMIP5 QC Record : MOHC - CMIP5 Quality Control Data Level 2")
    tu.assert_str(ext.type_display_name, "QC Record")
    tu.assert_int(ext.summary_fields, 1)
    tu.assert_str(ext.summary_fields[0], "cmip5.output1.", True)
开发者ID:NCPP,项目名称:esdoc-py-client,代码行数:12,代码来源:test_type_cim_v1_quality_cim_quality.py


示例20: assert_extension_info

def assert_extension_info(ext):
    """Asserts a document's extension information.

    :param object ext: Document extension information.

    """
    tu.assert_str(ext.display_name, u"amip")
    tu.assert_str(ext.description, u"Six element ensemble", True)
    tu.assert_str(ext.full_display_name, u"CMIP5 Ensemble : MOHC - amip")
    tu.assert_int(ext.summary_fields, 2)
    tu.assert_str(ext.summary_fields[0], u"amip")
    tu.assert_str(ext.summary_fields[1], u"3.3 AMIP and AMIP Ensemble")
开发者ID:ES-DOC,项目名称:esdoc-py-client,代码行数:12,代码来源:test_type_cim_v1_activity_ensemble_1.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python test_utils.captured_output函数代码示例发布时间:2022-05-27
下一篇:
Python test_util.mocked_urls函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap