def test_results_for_zip_code(self): """Test that results for zip code are correct""" results = sales_data.results_for_zip_code("10460") correct = [ { "summary_stats": { "Total Number of Sales": "95", "Median Price Per Sq. Foot": "$157", "Median Price": "$460,000", "Median Price Per Residential Unit": "$150,000", }, "name": "ZIP Code 10460", }, { "summary_stats": { "Total Number of Sales": "2,794", "Median Price Per Sq. Foot": "$180", "Median Price": "$415,000", "Median Price Per Residential Unit": "$197,500", }, "name": "The Bronx", }, { "summary_stats": { "Total Number of Sales": "221", "Median Price Per Sq. Foot": "$162", "Median Price": "$117,000", "Median Price Per Residential Unit": "$111,333", }, "name": u"Parkchester ", }, { "summary_stats": { "Total Number of Sales": "2,794", "Median Price Per Sq. Foot": "$180", "Median Price": "$415,000", "Median Price Per Residential Unit": "$197,500", }, "name": "New York City", }, ] self.assertEqual(results, correct)
def test_results_for_zip_code(self): '''Test that results for zip code are correct''' results = sales_data.results_for_zip_code('10460') correct = [{ 'summary_stats': { 'Total Number of Sales': '95', 'Median Price Per Sq. Foot': '$157', 'Median Price': '$460,000', 'Median Price Per Residential Unit': '$150,000' }, 'name': 'ZIP Code 10460' }, { 'summary_stats': { 'Total Number of Sales': '2,794', 'Median Price Per Sq. Foot': '$180', 'Median Price': '$415,000', 'Median Price Per Residential Unit': '$197,500' }, 'name': 'The Bronx' }, { 'summary_stats': { 'Total Number of Sales': '221', 'Median Price Per Sq. Foot': '$162', 'Median Price': '$117,000', 'Median Price Per Residential Unit': '$111,333' }, 'name': u'Parkchester ' }, { 'summary_stats': { 'Total Number of Sales': '2,794', 'Median Price Per Sq. Foot': '$180', 'Median Price': '$415,000', 'Median Price Per Residential Unit': '$197,500' }, 'name': 'New York City' }] self.assertEqual(results, correct)
def test_no_results_raises(self): """No results should raise NoResultsException""" with self.assertRaises(data.NoResultsException): sales_data.results_for_zip_code("00000")
def test_no_results_raises(self): '''No results should raise NoResultsException''' with self.assertRaises(data.NoResultsException): sales_data.results_for_zip_code('00000')