<s> import pytest <EOL> import requests_mock <EOL> import re <EOL> from data . api . cde import ( <EOL> MODE_PUBLIC , <EOL> MODE_PRIVATE , <EOL> CdeSchoolSearchForm , <EOL> CdeSchoolSearchList , <EOL> PaginatedCdeSchoolSearchResults , <EOL> CdeSchoolDetail <EOL> ) <EOL> from . test_constants import * <EOL> ENDPOINT_REGEX = re . compile ( r'<STR_LIT>' ) <EOL> @ pytest . fixture <EOL> def search_form ( ) : <EOL> return CdeSchoolSearchForm ( ) <EOL> @ pytest . fixture <EOL> def search_session_token ( search_form ) : <EOL> return search_form . init_search ( mode = MODE_PUBLIC ) <EOL> @ pytest . fixture <EOL> def search_results_page ( search_session_token ) : <EOL> return PaginatedCdeSchoolSearchResults ( token = search_session_token , page = <NUM_LIT:1> ) <EOL> @ pytest . fixture <EOL> @ requests_mock . Mocker ( ) <EOL> def public_school_detail ( mock ) : <EOL> mock . get ( <EOL> CDE_BASE_URL + CDE_PUBLIC_SCHOOL_ENDPOINT , <EOL> text = CDE_PUBLIC_SCHOOL_DETAIL_HTML <EOL> ) <EOL> return CdeSchoolDetail ( CDE_PUBLIC_SCHOOL_ENDPOINT ) . to_dict ( ) <EOL> @ pytest . fixture <EOL> @ requests_mock . Mocker ( ) <EOL> def private_school_detail ( mock ) : <EOL> mock . get ( <EOL> CDE_BASE_URL + CDE_PRIVATE_SCHOOL_ENDPOINT , <EOL> text = CDE_PRIVATE_SCHOOL_DETAIL_HTML <EOL> ) <EOL> return CdeSchoolDetail ( CDE_PRIVATE_SCHOOL_ENDPOINT ) . to_dict ( ) <EOL> def test_cde_school_search_form ( search_form ) : <EOL> search_form . request_new_form ( ) <EOL> assert search_form . form <EOL> def test_cde_school_search_form_token ( search_session_token ) : <EOL> assert search_session_token . get ( '<STR_LIT>' ) <EOL> def test_cde_school_search_results_page ( search_results_page ) : <EOL> results = search_results_page . get_search_results ( ) <EOL> assert len ( results ) > <NUM_LIT:1> <EOL> assert all ( ENDPOINT_REGEX . match ( i ) for i in results ) <EOL> assert search_results_page . next_page <EOL> def test_cde_school_search_list ( ) : <EOL> school_list = CdeSchoolSearchList ( mode = MODE_PRIVATE ) . schools <EOL> assert len ( school_list ) > <NUM_LIT:1> <EOL> class TestCdeSchoolDetail : <EOL> def test_public_school_detail ( self , public_school_detail ) : <EOL> assert isinstance ( public_school_detail , dict ) <EOL> code = public_school_detail . get ( '<STR_LIT:code>' ) <EOL> assert code <EOL> assert ENDPOINT_REGEX . match ( CDE_PUBLIC_SCHOOL_ENDPOINT ) . group ( <NUM_LIT:1> ) == code <EOL> def test_public_school_detail_phone ( self , public_school_detail ) : <EOL> assert public_school_detail . get ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> def test_public_school_detail_name ( self , public_school_detail ) : <EOL> assert public_school_detail . get ( '<STR_LIT:name>' ) == '<STR_LIT>' <EOL> def test_public_school_detail_status ( self , public_school_detail ) : <EOL> assert public_school_detail . get ( '<STR_LIT:status>' ) == '<STR_LIT>' <EOL> def test_public_school_detail_grades ( self , public_school_detail ) : <EOL> assert public_school_detail . get ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> assert public_school_detail . get ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> def test_public_school_detail_nces_id ( self , public_school_detail ) : <EOL> assert public_school_detail . get ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> def test_public_school_detail_county ( self , public_school_detail ) : <EOL> assert public_school_detail . get ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> def test_public_school_detail_district ( self , public_school_detail ) : <EOL> assert public_school_detail . get ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> def test_public_school_detail_address ( self , public_school_detail ) : <EOL> assert public_school_detail . get ( '<STR_LIT:address>' ) == '<STR_LIT>' <EOL> def test_public_school_detail_school_type ( self , public_school_detail ) : <EOL> assert public_school_detail . get ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> def test_public_school_detail_year_round ( self , public_school_detail ) : <EOL> assert public_school_detail . get ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> def test_public_school_detail_charter ( self , public_school_detail ) : <EOL> assert public_school_detail . get ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> def test_public_school_detail_charter_number ( self , public_school_detail ) : <EOL> assert public_school_detail . get ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> def test_public_school_detail_charter_funding ( self , public_school_detail ) : <EOL> assert public_school_detail . get ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> def test_public_school_detail_open_date ( self , public_school_detail ) : <EOL> assert public_school_detail . get ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> def test_public_school_detail_close_date ( self , public_school_detail ) : <EOL> assert public_school_detail . get ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> def test_public_school_detail_fax ( self , public_school_detail ) : <EOL> assert public_school_detail . get ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> def test_public_school_detail_email ( self , public_school_detail ) : <EOL> assert public_school_detail . get ( '<STR_LIT:email>' ) == '<STR_LIT>' <EOL> def test_public_school_detail_website ( self , public_school_detail ) : <EOL> assert public_school_detail . get ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> def test_public_school_detail_administrators ( self , public_school_detail ) : <EOL> assert public_school_detail . get ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> def test_public_school_detail_mailing_address ( self , public_school_detail ) : <EOL> assert public_school_detail . get ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> def test_public_school_detail_stats ( self , public_school_detail ) : <EOL> assert public_school_detail . get ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> def test_private_school_detail_district ( self , private_school_detail ) : <EOL> assert private_school_detail . get ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> def test_private_school_detail_close_date ( self , private_school_detail ) : <EOL> assert private_school_detail . get ( '<STR_LIT>' ) == '<STR_LIT>' </s>
