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


Python Organization.validate方法代码示例

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


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

示例1: test_org_add_post

# 需要导入模块: from pupa.scrape import Organization [as 别名]
# 或者: from pupa.scrape.Organization import validate [as 别名]
def test_org_add_post():
    """ Test that we can hack posts in on the fly'"""
    orga = Organization("name", classification="committee")
    orga.add_source(url='foo')
    orga.validate()

    orga.add_post("Human Readable Name", "Chef")

    assert orga._related[0].role == "Chef"
    assert orga._related[0].label == "Human Readable Name"
开发者ID:influence-usa,项目名称:pupa,代码行数:12,代码来源:test_people_org_scrape.py

示例2: test_no_source_on_party_org

# 需要导入模块: from pupa.scrape import Organization [as 别名]
# 或者: from pupa.scrape.Organization import validate [as 别名]
def test_no_source_on_party_org():
    org = Organization('Hat', classification='party')
    # no source? no problem because classification = party
    org.validate()
开发者ID:influence-usa,项目名称:pupa,代码行数:6,代码来源:test_people_org_scrape.py

示例3: test_basic_invalid_organization

# 需要导入模块: from pupa.scrape import Organization [as 别名]
# 或者: from pupa.scrape.Organization import validate [as 别名]
def test_basic_invalid_organization():
    orga = Organization("name")

    # no source
    with pytest.raises(ValidationError):
        orga.validate()
开发者ID:influence-usa,项目名称:pupa,代码行数:8,代码来源:test_people_org_scrape.py

示例4: test_basic_organization

# 需要导入模块: from pupa.scrape import Organization [as 别名]
# 或者: from pupa.scrape.Organization import validate [as 别名]
def test_basic_organization():
    org = Organization('some org', classification='committee')
    org.add_source('http://example.com')
    assert org.name in str(org)
    org.validate()
开发者ID:influence-usa,项目名称:pupa,代码行数:7,代码来源:test_people_org_scrape.py


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