Exemplo n.º 1
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]
Exemplo n.º 2
0
def test_where_returns_no_events():
    assert len(FundingRaised.where({'company_name': 'NotFacebook'})) == 0
Exemplo n.º 3
0
def test_where_returns_events_by_type():
    assert len(FundingRaised.where({'round': 'a'})) == 582
Exemplo n.º 4
0
def test_where_returns_events_by_company():
    assert len(FundingRaised.where({
        'company_name': 'Facebook',
        'round': 'a'
    })) == 1
Exemplo n.º 5
0
def test_where_returns_events_by_state():
    assert len(FundingRaised.where({'state': 'CA'})) == 873
Exemplo n.º 6
0
def test_where_returns_events_by_city():
    assert len(FundingRaised.where({'city': 'Tempe'})) == 3