示例#1
0
文件: logic_test.py 项目: hylhero/h
def test_index_with_multiple_users(NipsaUser):
    nipsa_user1 = mock.Mock()
    nipsa_user1.userid = "test_id1"
    nipsa_user2 = mock.Mock()
    nipsa_user2.userid = "test_id2"
    nipsa_user3 = mock.Mock()
    nipsa_user3.userid = "test_id3"
    NipsaUser.all.return_value = [nipsa_user1, nipsa_user2, nipsa_user3]

    assert logic.index() == ["test_id1", "test_id2", "test_id3"]
示例#2
0
def test_index_with_multiple_users(NipsaUser):
    nipsa_user1 = mock.Mock()
    nipsa_user1.userid = "test_id1"
    nipsa_user2 = mock.Mock()
    nipsa_user2.userid = "test_id2"
    nipsa_user3 = mock.Mock()
    nipsa_user3.userid = "test_id3"
    NipsaUser.all.return_value = [nipsa_user1, nipsa_user2, nipsa_user3]

    assert logic.index() == ["test_id1", "test_id2", "test_id3"]
示例#3
0
文件: logic_test.py 项目: hylhero/h
def test_index_with_no_users(NipsaUser):
    NipsaUser.all.return_value = []

    assert logic.index() == []
示例#4
0
文件: logic_test.py 项目: hylhero/h
def test_index_with_one_user(NipsaUser):
    nipsa_user = mock.Mock()
    nipsa_user.userid = "test_id"
    NipsaUser.all.return_value = [nipsa_user]

    assert logic.index() == ["test_id"]
示例#5
0
def test_index_with_no_users(NipsaUser):
    NipsaUser.all.return_value = []

    assert logic.index() == []
示例#6
0
def test_index_with_one_user(NipsaUser):
    nipsa_user = mock.Mock()
    nipsa_user.userid = "test_id"
    NipsaUser.all.return_value = [nipsa_user]

    assert logic.index() == ["test_id"]