예제 #1
0
    def test_nrel_utility_api_results(self):
        """
        """

        address = '2114 Bigelow Ave Seattle, WA, 98109'

        # create expected result from mock data
        response_mock = json.loads(MOCK_DATA_NREL_RESPONSE)

        # create response from zillow
        nrel_data = NRELUtilityWrapper(NREL_API_KEY)
        response_nrel = nrel_data.get_nrel_utility_data(address)

        # compare expected with real result
        self.assertEqual(json.dumps(response_mock), json.dumps(response_nrel))
예제 #2
0
    def test_nrel_utility_api_results(self):
        """
        """

        address = '2114 Bigelow Ave Seattle, WA, 98109'

        # create expected result from mock data
        response_mock = json.loads(MOCK_DATA_NREL_RESPONSE)

        # create response from zillow
        nrel_data = NRELUtilityWrapper(NREL_API_KEY)
        response_nrel = nrel_data.get_nrel_utility_data(address)

        # compare expected with real result
        self.assertEqual(json.dumps(response_mock), json.dumps(response_nrel))
예제 #3
0
    def test_nrel_utility_results(self):
        """
        """

        address = '2114 Bigelow Ave Seattle, WA, 98109'

        nrel_data = NRELUtilityWrapper(NREL_API_KEY)
        nrel_response = nrel_data.get_nrel_utility_data(address)
        result = NRELUtilityResults(nrel_response) 

        self.assertEqual(result.utility_name, 'Seattle City Light')
        self.assertEqual(result.address, '2114 Bigelow Ave Seattle, WA, 98109')
        self.assertEqual(result.zipcode, '98109')
        self.assertEqual(result.utility_list, [['Seattle City Light', '16868']])
        self.assertEqual(result.commercial, float('0.0661'))
        self.assertEqual(result.industrial, float('0.0573'))
        self.assertEqual(result.residential, float('0.076'))
예제 #4
0
    def test_nrel_utility_results(self):
        """
        """

        address = '2114 Bigelow Ave Seattle, WA, 98109'

        nrel_data = NRELUtilityWrapper(NREL_API_KEY)
        nrel_response = nrel_data.get_nrel_utility_data(address)
        result = NRELUtilityResults(nrel_response)

        self.assertEqual(result.utility_name, 'Seattle City Light')
        self.assertEqual(result.address, '2114 Bigelow Ave Seattle, WA, 98109')
        self.assertEqual(result.zipcode, '98109')
        self.assertEqual(result.utility_list, [['Seattle City Light', '16868']])
        self.assertEqual(result.commercial, float('0.068'))
        self.assertEqual(result.industrial, float('0.0595'))
        self.assertEqual(result.residential, float('0.0775'))
        self.assertEqual(str(result), 'Seattle City Light')