コード例 #1
0
ファイル: test_dao.py プロジェクト: jaunis/xivo-dao
    def test_find_user_not_right_firstname(self):
        firstname = 'Lord'
        lastname = 'Sanderson'
        wrong_firstname = 'Gregory'

        self.add_user(firstname=firstname, lastname=lastname)

        result = user_dao.find_user(wrong_firstname, lastname)

        assert_that(result, equal_to(None))
コード例 #2
0
    def test_find_user_two_users_same_name(self):
        firstname = 'Lord'
        lastname = 'Sanderson'

        user1 = self.add_user(firstname=firstname, lastname=lastname)
        user2 = self.add_user(firstname=firstname, lastname=lastname)

        result = user_dao.find_user(firstname, lastname)

        assert_that(result, has_property('id', any_of(user1.id, user2.id)))
コード例 #3
0
    def test_find_user_not_right_firstname(self):
        firstname = 'Lord'
        lastname = 'Sanderson'
        wrong_firstname = 'Gregory'

        self.add_user(firstname=firstname, lastname=lastname)

        result = user_dao.find_user(wrong_firstname, lastname)

        assert_that(result, equal_to(None))
コード例 #4
0
ファイル: test_dao.py プロジェクト: jaunis/xivo-dao
    def test_find_user_two_users_same_name(self):
        firstname = 'Lord'
        lastname = 'Sanderson'

        user1 = self.add_user(firstname=firstname, lastname=lastname)
        user2 = self.add_user(firstname=firstname, lastname=lastname)

        result = user_dao.find_user(firstname, lastname)

        assert_that(result, has_property('id', any_of(user1.id, user2.id)))
コード例 #5
0
    def test_find_user(self):
        firstname = 'Lord'
        lastname = 'Sanderson'
        user = self.add_user(firstname=firstname, lastname=lastname)

        result = user_dao.find_user('Lord', 'Sanderson')

        assert_that(
            result,
            all_of(has_property('id', user.id),
                   has_property('firstname', firstname),
                   has_property('lastname', lastname)))
コード例 #6
0
ファイル: test_dao.py プロジェクト: jaunis/xivo-dao
    def test_find_user(self):
        firstname = 'Lord'
        lastname = 'Sanderson'
        user = self.add_user(firstname=firstname, lastname=lastname)

        result = user_dao.find_user('Lord', 'Sanderson')

        assert_that(result, all_of(
            has_property('id', user.id),
            has_property('firstname', firstname),
            has_property('lastname', lastname)
        ))
コード例 #7
0
    def test_find_user_no_user(self):
        result = user_dao.find_user('abc', 'def')

        assert_that(result, equal_to(None))
コード例 #8
0
ファイル: test_dao.py プロジェクト: jaunis/xivo-dao
    def test_find_user_no_user(self):
        result = user_dao.find_user('abc', 'def')

        assert_that(result, equal_to(None))
コード例 #9
0
ファイル: user_helper.py プロジェクト: jaunis/xivo-acceptance
def find_user_by_name(name):
    firstname, lastname = name.split(" ")
    return user_dao.find_user(firstname, lastname)
コード例 #10
0
def find_by_firstname_lastname(firstname, lastname):
    return user_dao.find_user(firstname, lastname)
コード例 #11
0
def find_user_by_name(name):
    firstname, lastname = name.split(" ")
    return user_dao.find_user(firstname, lastname)