def test_home_gets_property_info(self, home_detail_source): sut_home = Home(home_detail_source) sut_home.update_property_details() expected = {'Attachedgarage': 'Yes'} assert sut_home.info == Home.create_info_from_keywords(**expected).info
def test_home_gets_school_info(self, home_detail_source): sut_home = Home(home_detail_source) sut_home.update_school_info() expected = {'Schools': '4|5|7'} assert sut_home.info == Home.create_info_from_keywords(**expected).info
def test_home_gets_pool_info(self): with open('test_data/pool.html', 'r') as f: html = f.read() sut_home = Home(html) sut_home.update_property_details() expected = {'Privatepool': 'Yes'} assert sut_home.info == Home.create_info_from_keywords(**expected).info
def test_home_gets_basic_info(self, home_detail_source): sut_home = Home(home_detail_source) sut_home.update_basic_home_info() expected = { 'Price': 209000, 'Address': '6015 Crakston St, Houston, TX 77084', 'Bed': '3 bd', 'Bath': '2 ba', 'Sqft': '1,906 sqft' } assert sut_home.info == Home.create_info_from_keywords(**expected).info
def test_home_gets_facts(self, home_detail_source): sut_home = Home(home_detail_source) sut_home.update_home_facts() expected = { 'Cooling': 'Central', 'Lot': '5,501 sqft', 'Type': 'Single Family', 'Yearbuilt': '2012', 'Pricesqft': '$110', 'Heating': 'Other', 'Parking': '2 spaces' } assert sut_home.info == Home.create_info_from_keywords(**expected).info