Exemplo n.º 1
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"]
Exemplo n.º 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"]
Exemplo n.º 3
0
def test_index_with_no_users(NipsaUser):
    NipsaUser.all.return_value = []

    assert logic.index() == []
Exemplo n.º 4
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"]
Exemplo n.º 5
0
def test_index_with_no_users(NipsaUser):
    NipsaUser.all.return_value = []

    assert logic.index() == []
Exemplo n.º 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"]