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


Python ApplicationFixtureFactory.make_application_spread方法代码示例

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


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

示例1: test_03_apps_by_country

# 需要导入模块: from doajtest.fixtures import ApplicationFixtureFactory [as 别名]
# 或者: from doajtest.fixtures.ApplicationFixtureFactory import make_application_spread [as 别名]
    def test_03_apps_by_country(self):
        apps = ApplicationFixtureFactory.make_application_spread(APPLICATION_YEAR_OUTPUT, "year")
        for a in apps:
            a.save()
        time.sleep(2)

        outfiles = reporting.content_reports("1970-01-01T00:00:00Z", dates.now(), TMP_DIR)

        assert len(outfiles) == 1
        assert os.path.exists(outfiles[0])

        table = []
        with codecs.open(outfiles[0], "rb", "utf-8") as f:
            reader = clcsv.UnicodeReader(f)
            for row in reader:
                table.append(row)

        expected = self._as_output(APPLICATION_YEAR_OUTPUT)
        assert table == expected
开发者ID:DOAJ,项目名称:doaj,代码行数:21,代码来源:test_reporting.py

示例2: test_04_background

# 需要导入模块: from doajtest.fixtures import ApplicationFixtureFactory [as 别名]
# 或者: from doajtest.fixtures.ApplicationFixtureFactory import make_application_spread [as 别名]
    def test_04_background(self):
        provs = ProvenanceFixtureFactory.make_action_spread(MONTH_EDIT_OUTPUT, "edit", "month")
        for p in provs:
            p.save()

        apps = ApplicationFixtureFactory.make_application_spread(APPLICATION_YEAR_OUTPUT, "year")
        for a in apps:
            a.save()

        time.sleep(2)

        job = reporting.ReportingBackgroundTask.prepare("system", outdir=TMP_DIR, from_date="1970-01-01T00:00:00Z", to_date=dates.now())
        reporting.ReportingBackgroundTask.submit(job)

        time.sleep(2)

        job = models.BackgroundJob.pull(job.id)
        prov_outfiles = job.reference["reporting__provenance_outfiles"]
        cont_outfiles = job.reference["reporting__content_outfiles"]

        assert len(prov_outfiles) == 4
        assert len(cont_outfiles) == 1
开发者ID:DOAJ,项目名称:doaj,代码行数:24,代码来源:test_reporting.py


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