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

Python allocation.AllocationRequest类代码示例

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

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



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

示例1: test_lastmod

 def test_lastmod(self):
     expected_datetime = datetime(2014, 10, 13)
     request0 = AllocationRequest(project_name="Project X", status="E")
     request0.modified_time = expected_datetime
     site_map = AllocationsSitemap()
     actual_modification_datetime = site_map.lastmod(request0)
     self.assertEquals(expected_datetime, actual_modification_datetime)
开发者ID:,项目名称:,代码行数:7,代码来源:


示例2: test_apply_for_code_to_summary_for2

 def test_apply_for_code_to_summary_for2(self):
     allocation_summary = dict()
     code = '12'
     AllocationRequest.apply_for_code_to_summary(allocation_summary, code)
     self.assertEqual(allocation_summary['for_6'], '12')
     self.assertEqual(allocation_summary['for_4'], '12')
     self.assertEqual(allocation_summary['for_2'], '12')
开发者ID:,项目名称:,代码行数:7,代码来源:


示例3: test_location

 def test_location(self):
     request0 = AllocationRequest(project_name="Project X", status="E")
     request0.id = 12345
     site_map = AllocationsSitemap()
     actual_location = site_map.location(request0)
     expected_location = '/allocations/applications/12345/approved'
     self.assertEquals(expected_location, actual_location)
开发者ID:,项目名称:,代码行数:7,代码来源:


示例4: test_partition_active_allocations

    def test_partition_active_allocations(self):
        sub_allocations = AllocationRequest.partition_active_allocations()
        self.assertEquals(len(sub_allocations), 3)
        sub_allocations.sort(key=lambda summary: summary['project_name']
                             + str(summary['id']))

        sub_allocation = sub_allocations[0]
        self.assertEquals('qqqqqq.edu.au', sub_allocation['institution'])
        self.assertEquals('USQ eResearch Services Sandbox',
                          sub_allocation['project_name'])
        self.assertEquals('099901', sub_allocation['for_6'])
        self.assertEquals('0999', sub_allocation['for_4'])
        self.assertEquals('09', sub_allocation['for_2'])
        self.assertAlmostEqual(1.2, sub_allocation['instance_quota'], 2)
        self.assertAlmostEqual(2.4, sub_allocation['core_quota'], 2)

        sub_allocation = sub_allocations[1]
        self.assertEquals('qqqqqq.edu.au', sub_allocation['institution'])
        self.assertEquals('USQ eResearch Services Sandbox',
                          sub_allocation['project_name'])
        self.assertEquals('070104', sub_allocation['for_6'])
        self.assertEquals('0701', sub_allocation['for_4'])
        self.assertEquals('07', sub_allocation['for_2'])
        self.assertAlmostEqual(0.8, sub_allocation['instance_quota'], 2)
        self.assertAlmostEqual(1.6, sub_allocation['core_quota'], 2)

        sub_allocation = sub_allocations[2]
        self.assertEquals('gggg.edu.au', sub_allocation['institution'])
        self.assertEquals('UoM_Trajectory_Inference_Attacks',
                          sub_allocation['project_name'])
        self.assertEquals('080109', sub_allocation['for_6'])
        self.assertEquals('0801', sub_allocation['for_4'])
        self.assertEquals('08', sub_allocation['for_2'])
        self.assertAlmostEqual(30.0, sub_allocation['instance_quota'], 2)
        self.assertAlmostEqual(30.0, sub_allocation['core_quota'], 2)
开发者ID:rrothwell,项目名称:langstroth,代码行数:35,代码来源:test_db_allocation.py


示例5: test_strip_email_group_translates_selection

 def test_strip_email_group_translates_selection(self):
     file_name = path_for_tests("institution_cleaning.json")
     with open(file_name) as institutions_file:
         institutions = json.load(institutions_file)
     for institution in institutions:
         self.assertEqual(AllocationRequest.strip_email_sub_domains(
             institution['original']),
             institution['processed'])
开发者ID:,项目名称:,代码行数:8,代码来源:


示例6: test_find_active_allocations_excluding_3_null_fors

 def test_find_active_allocations_excluding_3_null_fors(self):
     request0 = AllocationRequest(project_name='Project0', status='A')
     request0.field_of_research_1 = None
     request0.field_of_research_2 = None
     request0.field_of_research_3 = None
     request0.save()
     allocations = AllocationRequest.find_active_allocations()
     self.assertEquals(2, len(allocations))
开发者ID:rrothwell,项目名称:langstroth,代码行数:8,代码来源:test_db_allocation.py


示例7: test_find_active_allocations_including_new_requests

 def test_find_active_allocations_including_new_requests(self):
     request0 = AllocationRequest(project_name='Project0', status='A')
     request0.field_of_research_1 = '11'
     request0.field_of_research_2 = '22'
     request0.field_of_research_3 = '33'
     request0.save()
     allocations = AllocationRequest.find_active_allocations()
     self.assertEquals(3, len(allocations))
开发者ID:rrothwell,项目名称:langstroth,代码行数:8,代码来源:test_db_allocation.py


示例8: test_get_all_for_project_with_privacy

    def test_get_all_for_project_with_privacy(self):
        AllocationRequest.show_private_fields = False
        request_id = 1654
        project_allocations = AllocationRequest.get_all_for_project(request_id)

        self.assertEquals(1, len(project_allocations))
        self.assertEquals('UoM_Trajectory_Inference_Attacks',
                          project_allocations[0]['project_name'])
        self.assertEquals('2014-01-06', project_allocations[0]['start_date'])
        self.assertEquals('2014-01-31', project_allocations[0]['end_date'])
        self.assertFalse('use_case' in project_allocations[0])
        self.assertFalse('usage_patterns' in project_allocations[0])
开发者ID:rrothwell,项目名称:langstroth,代码行数:12,代码来源:test_db_allocation.py


示例9: test_organise_allocations_tree

    def test_organise_allocations_tree(self):
        allocations_tree = AllocationRequest.organise_allocations_tree()
        self.assertEquals(3, len(allocations_tree))

        self.assertEquals('USQ eResearch Services Sandbox',
                          allocations_tree['09']['0999']
                          ['099901'][0]['projectName'])
        self.assertEquals('USQ eResearch Services Sandbox',
                          allocations_tree['07']['0701']
                          ['070104'][0]['projectName'])
        self.assertEquals('UoM_Trajectory_Inference_Attacks',
                          allocations_tree['08']['0801']
                          ['080109'][0]['projectName'])
开发者ID:rrothwell,项目名称:langstroth,代码行数:13,代码来源:test_db_allocation.py


示例10: test_get_all_for_project

    def test_get_all_for_project(self):
        AllocationRequest.show_private_fields = True
        request_id = 1654
        project_allocations = AllocationRequest.get_all_for_project(request_id)

        self.assertEquals(1, len(project_allocations))
        self.assertEquals('UoM_Trajectory_Inference_Attacks',
                          project_allocations[0]['project_name'])
        self.assertEquals('2014-01-06', project_allocations[0]['start_date'])
        self.assertEquals('2014-01-31', project_allocations[0]['end_date'])
        expected_usecase = "In this project, an algorithm has been " \
            "developed to infer a persons road trajectory " \
            "using POI information sent to a LBS such as " \
            "Google Maps.\r\n\r\n Please contact [XXXX]."
        self.assertEquals(expected_usecase, project_allocations[0]['use_case'])
        self.assertEquals('Data is stored on a remote server so no storage '
                          'is needed. Please contact [XXXX].',
                          project_allocations[0]['usage_patterns'])
开发者ID:rrothwell,项目名称:langstroth,代码行数:18,代码来源:test_db_allocation.py


示例11: test_redact_two_emails_in_field

 def test_redact_two_emails_in_field(self):
     self.assertEqual(AllocationRequest.redact_all_emails(
         'Please contact [email protected] '
         'or [email protected] for more information'),
         'Please contact [XXXX] '
         'or [XXXX] for more information')
开发者ID:,项目名称:,代码行数:6,代码来源:


示例12: test_redact_one_email_with_bracket

 def test_redact_one_email_with_bracket(self):
     self.assertEqual(AllocationRequest.redact_all_emails(
         'Please contact [email protected])'),
         'Please contact [XXXX])')
开发者ID:,项目名称:,代码行数:4,代码来源:


示例13: test_redact_one_email

 def test_redact_one_email(self):
     self.assertEqual(AllocationRequest.redact_all_emails(
         'Please contact [email protected] for more information'),
         'Please contact [XXXX] for more information')
开发者ID:,项目名称:,代码行数:4,代码来源:


示例14: test_redact_no_emails

 def test_redact_no_emails(self):
     self.assertEqual(AllocationRequest.redact_all_emails(
         'Please contact someone for more information'),
         'Please contact someone for more information')
开发者ID:,项目名称:,代码行数:4,代码来源:


示例15: test_strip_email_group_noprefix

 def test_strip_email_group_noprefix(self):
     self.assertEqual(AllocationRequest.strip_email_sub_domains(
         'uon.edu.au'),
         'uon.edu.au')
开发者ID:,项目名称:,代码行数:4,代码来源:


示例16: items

 def items(self):
     return AllocationRequest.find_active_allocations()
开发者ID:,项目名称:,代码行数:2,代码来源:


示例17: test_strip_email_group_prefix_studentmail

 def test_strip_email_group_prefix_studentmail(self):
     self.assertEqual(AllocationRequest.strip_email_sub_domains(
         'studentmail.newcastle.edu.au'),
         'newcastle.edu.au')
开发者ID:,项目名称:,代码行数:4,代码来源:


示例18: test_extract_email_domain

 def test_extract_email_domain(self):
     self.assertEqual(AllocationRequest.extract_email_domain(
         '[email protected]'),
         'myune.edu.au')
开发者ID:,项目名称:,代码行数:4,代码来源:


示例19: test_strip_email_group_translates_domain_myune

 def test_strip_email_group_translates_domain_myune(self):
     self.assertEqual(AllocationRequest.strip_email_sub_domains(
         'myune.edu.au'),
         'une.edu.au')
开发者ID:,项目名称:,代码行数:4,代码来源:


示例20: test_strip_email_group_translates_domain_usydney

 def test_strip_email_group_translates_domain_usydney(self):
     self.assertEqual(AllocationRequest.strip_email_sub_domains(
         'usyd.edu.au'),
         'sydney.edu.au')
开发者ID:,项目名称:,代码行数:4,代码来源:



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python staging.tnm_stage函数代码示例发布时间:2022-05-27
下一篇:
Python report.DownloadReport类代码示例发布时间: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