Ejemplo n.º 1
0
def test_find_by_event_by_state():
    row = FundingRaised.find_by({'state': 'CA'})
    keys = [
        'permalink', 'company_name', 'number_employees', 'category', 'city',
        'state', 'funded_date', 'raised_amount', 'raised_currency', 'round'
    ]
    values = [
        'digg', 'Digg', '60', 'web', 'San Francisco', 'CA', '1-Dec-06',
        '8500000', 'USD', 'b'
    ]
    for i in range(0, len(keys)):
        assert row[keys[i]] == values[i]
Ejemplo n.º 2
0
def test_where_returns_correct_keys():
    row = FundingRaised.where({'company_name': 'Facebook'})[0]
    keys = [
        'permalink', 'company_name', 'number_employees', 'category', 'city',
        'state', 'funded_date', 'raised_amount', 'raised_currency', 'round'
    ]
    values = [
        'facebook', 'Facebook', '450', 'web', 'Palo Alto', 'CA', '1-Sep-04',
        '500000', 'USD', 'angel'
    ]
    for i in range(0, len(keys)):
        assert row[keys[i]] == values[i]
Ejemplo n.º 3
0
def test_where_returns_no_events():
    assert len(FundingRaised.where({'company_name': 'NotFacebook'})) == 0
Ejemplo n.º 4
0
def test_where_returns_events_by_type():
    assert len(FundingRaised.where({'round': 'a'})) == 582
Ejemplo n.º 5
0
def test_where_returns_events_by_company():
    assert len(FundingRaised.where({
        'company_name': 'Facebook',
        'round': 'a'
    })) == 1
Ejemplo n.º 6
0
def test_where_returns_events_by_state():
    assert len(FundingRaised.where({'state': 'CA'})) == 873
Ejemplo n.º 7
0
def test_where_returns_events_by_city():
    assert len(FundingRaised.where({'city': 'Tempe'})) == 3