# Path: cptm/utils/dutchdata.py
# def get_coalition_parties(date=None, cabinet=None):
#     coalitions = read_coalitions()
#     if date is not None:
#         coalitions = coalitions[['1', '2', '3', '4']]
#         d = datetime.datetime.strptime(date, "%Y-%m-%d").date()
#         print d
#         i = coalitions.index.searchsorted(d)
#         print i
#         c = coalitions.ix[coalitions.index[i-1]].tolist()
#         return [p for p in c if str(p) != 'nan']
#     if cabinet is not None:
#         parties = coalitions[coalitions['Name'] == cabinet]
#         parties = parties[['1', '2', '3', '4']].values[0].tolist()
#         return [p for p in parties if not str(p) == 'nan']
#     return []


from nose.tools import assert_equal
from cptm.utils.dutchdata import get_coalition_parties



def test_get_coalition_parties_empty():
    assert_equal(get_coalition_parties(), [])


def test_get_coalition_parties_name():
    assert_equal(get_coalition_parties(cabinet='Balkenende I'),
                 ['CDA', 'LPF', 'VVD'])


def test_get_coalition_parties_date():

# Path: cptm/utils/dutchdata.py
# def get_coalition_parties(date=None, cabinet=None):
#     coalitions = read_coalitions()
#     if date is not None:
#         coalitions = coalitions[['1', '2', '3', '4']]
#         d = datetime.datetime.strptime(date, "%Y-%m-%d").date()
#         print d
#         i = coalitions.index.searchsorted(d)
#         print i
#         c = coalitions.ix[coalitions.index[i-1]].tolist()
#         return [p for p in c if str(p) != 'nan']
#     if cabinet is not None:
#         parties = coalitions[coalitions['Name'] == cabinet]
#         parties = parties[['1', '2', '3', '4']].values[0].tolist()
#         return [p for p in parties if not str(p) == 'nan']
#     return []


# Path: cptm/tests/test_dutchdata.py
from nose.tools import assert_equal
from cptm.utils.dutchdata import get_coalition_parties




def test_get_coalition_parties_empty():
    assert_equal(get_coalition_parties(), [])


def test_get_coalition_parties_name():
    assert_equal(get_coalition_parties(cabinet='Balkenende I'),
                 ['CDA', 'LPF', 'VVD'])


def test_get_coalition_parties_date():

    assert_equal(get_coalition_parties(date='2007-10-22'),