def test_basic_methods_MatrixBooleanPrefDataModel():
    #Empty Dataset
    model = MatrixBooleanPrefDataModel({})
    assert_equals(model.dataset, {})
    assert_array_equal(np.array([]), model.user_ids())
    assert_array_equal(np.array([]), model.item_ids())
    assert_equals(False, model.has_preference_values())
    assert_equals(0, model.users_count())
    assert_equals(0, model.items_count())
    assert("MatrixBooleanPrefDataModel (0 by 0)" in model.__str__())

    #Simple DataSet
    model = MatrixBooleanPrefDataModel(movies_boolean)
    assert_equals(model.dataset, movies_boolean)
    assert_array_equal(np.array(['Leopoldo Pires', 'Lorena Abreu', 'Luciana Nunes',
      'Marcel Caraciolo', 'Maria Gabriela', 'Penny Frewman', 'Sheldom', 'Steve Gates']),
      model.user_ids())
    assert_array_equal(np.array(['Just My Luck', 'Lady in the Water', 'Snakes on a Plane',
               'Superman Returns', 'The Night Listener', 'You, Me and Dupree']), model.item_ids())
    assert_equals(False, model.has_preference_values())
    assert_equals(8, model.users_count())
    assert_equals(6, model.items_count())
    assert_array_equal(['Just My Luck', 'Lady in the Water',
             'Snakes on a Plane', 'Superman Returns',
             'The Night Listener', 'You, Me and Dupree'], model['Marcel Caraciolo'])
    elements = [pref  for pref in model]
    assert_array_equal(['Lady in the Water', 'Snakes on a Plane', \
         'Superman Returns', 'The Night Listener'], elements[0][1])
    assert("MatrixBooleanPrefDataModel (8 by 6)" in model.__str__())

    songs = load_sample_songs()
    model = MatrixBooleanPrefDataModel(songs.data)
    assert_equals(model.dataset, songs_boolean)
    assert_array_equal(np.array([1, 2, 3, 4, 5, 6, 7, 8]),
      model.user_ids())
    assert_array_equal(np.array([1, 2, 3, 4, 5, 6, 7, 8]), model.item_ids())
    assert_equals(False, model.has_preference_values())
    assert_equals(8, model.users_count())
    assert_equals(8, model.items_count())
    assert_equals(1.0, model.maximum_preference_value())
    assert_equals(0.0, model.minimum_preference_value())
    assert_array_equal([1, 2, 3, 4, 5, 6, 7], model[1])
    elements = [pref  for pref in model]
    assert_array_equal([1, 2, 3, 4, 5, 6, 7],
            elements[0][1])
    assert("MatrixBooleanPrefDataModel (8 by 8)" in model.__str__())
dataset/ETHPy150Open muricoca/crab/scikits/crab/models/tests/test_models.py/test_basic_methods_MatrixBooleanPrefDataModel/original