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


Python Database.get_applicants方法代码示例

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


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

示例1: get_all

# 需要导入模块: from db import Database [as 别名]
# 或者: from db.Database import get_applicants [as 别名]
 def get_all():
     from db import Database
     return Database.get_applicants()
开发者ID:CodecoolBP20161,项目名称:python-oop-exercises-2-DorciM,代码行数:5,代码来源:applicant.py

示例2: application_process_test_case

# 需要导入模块: from db import Database [as 别名]
# 或者: from db.Database import get_applicants [as 别名]
import unittest
from db import Database
from mentor import Mentor
from applicant import Applicant


mentors = Database.get_mentors()
applicants = Database.get_applicants()


class application_process_test_case(unittest.TestCase):
    def test_1_list_mentors_list_type_returned(self):
        result = Mentor._1_list_mentors()
        self.assertEqual(type(result).__name__, "list")

    def test_1_list_mentors_length(self):
        result = Mentor._1_list_mentors()
        self.assertEqual(len(result), 7)

    def test_1_list_mentors_has_dictionaries(self):
        result = Mentor._1_list_mentors()
        for mentor in result:
            self.assertEqual(type(mentor).__name__, "dict")

    def test_1_list_mentors_values(self):
        result = Mentor._1_list_mentors()
        self.assertEqual(result[0], {'first_name': 'Attila', 'last_name': 'Molnár'})
        self.assertEqual(result[4], {'first_name': 'Miklós', 'last_name': 'Beöthy'})
        self.assertEqual(result[6], {'first_name': 'Mateusz', 'last_name': 'Ostafil'})

    def test_2_list_mentors_from_miskolc_list_type_returned(self):
开发者ID:CodecoolBP20161,项目名称:python-application-process-base,代码行数:33,代码来源:test.py


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