def test__get_juridicType_juridic_person(self): contract = Contract(self.contract_id_3X) juridic_person = contract.juridicType self.assertEqual( juridic_person, 'juridicPerson-ESH' )
def test__get_selfConsumption(self): contract = Contract(self.contract_id) self_consumption = contract.selfConsumption self.assertEqual( self_consumption, '[00] - Sin Autoconsumo' )
def test__get_juridicType_physical_person(self): contract = Contract(self.contract_id) physical_person = contract.juridicType self.assertEqual( physical_person, 'physicalPerson' )
def test__get_version(self): contract = Contract(self.contract_id) version = contract.version self.assertEqual( version, 5 )
def test__get_experimentalgroup(self): contract = Contract(self.contract_id) experimental_group = contract.experimentalGroup self.assertEqual( experimental_group, True )
def test__get_no_service(self): contract = Contract(self.contract_id) service = contract.service self.assertEqual( service, {} )
def test__get_climaticZone_from_cups(self): contract = Contract(self.contract_id) climaticZone = contract.climaticZone self.assertEqual( climaticZone, 'C2' )
def test__get_powerHistory(self): contract = Contract(self.contract_id) power = contract.powerHistory self.assertListEqual( power, [ { 'power': {'P1': 6600.0}, 'dateStart': '2011-11-22T00:00:00-00:15Z', 'dateEnd': '2019-09-01T00:00:00-00:15Z', 'measurement_point': '05' }, { 'power': {'P1': 3400.0}, 'dateStart': '2019-09-02T00:00:00-00:15Z', 'dateEnd': '2021-05-31T00:00:00-00:15Z', 'measurement_point': '05' }, { 'power': {'P1-2': 3400.0, 'P3': 3400.0}, 'dateStart': '2021-06-01T00:00:00-00:15Z', 'dateEnd': '2021-11-21T00:00:00-00:15Z', 'measurement_point': '05' }, ] )
def test__get_tariffHistory(self): contract = Contract(13) tariff_history = contract.tariffHistory self.assertListEqual( tariff_history, [ { 'dateEnd': '2019-06-05T00:00:00-00:15Z', 'dateStart': '2011-12-31T00:00:00-00:15Z', 'tariffId': '2.0A', 'tariffPriceId': 4 }, { 'dateEnd': '2021-05-31T00:00:00-00:15Z', 'dateStart': '2019-06-06T00:00:00-00:15Z', 'tariffId': '2.0DHS', 'tariffPriceId': 18, }, { 'dateEnd': '2021-12-30T00:00:00-00:15Z', 'dateStart': '2021-06-01T00:00:00-00:15Z', 'tariffId': '2.0TD', 'tariffPriceId': 101 } ] )
def test__get_report(self): contract = Contract(self.contract_id) report = contract.report self.assertDictEqual( report, { 'language': 'ca_ES', 'initialMonth': 201111, } )
def test__get_current_power(self): contract = Contract(self.contract_id) power = contract.currentPower self.assertDictEqual( power, { 'power': {'P1-2': 3400, 'P3': 3400}, 'dateStart': '2021-06-01T00:00:00-00:15Z', 'dateEnd': '2021-11-21T00:00:00-00:15Z', 'measurement_point': '05' } )
def test__get_current_tariff(self): contract = Contract(self.contract_id) tariff = contract.currentTariff self.assertDictEqual( tariff, { 'dateEnd': '2021-11-21T00:00:00-00:15Z', 'dateStart': '2021-06-01T00:00:00-00:15Z', 'tariffId': '2.0TD', 'tariffPriceId': 101 } )
def test__get_contract_address(self): contract = Contract(self.contract_id) address =contract.address self.assertDictEqual( address, { 'city': 'Barcelona', 'cityCode': '08019', 'countryCode': 'ES', 'postalCode': '08036', 'provinceCode': '08', 'province': 'Barcelona', } )
def test__get_eprofile(self): contract = Contract(self.contract_id) profile = contract.eprofile self.assertDictEqual( profile, { 'totalPersonsNumber': 3, 'minorsPersonsNumber': 0, 'workingAgePersonsNumber': False, 'retiredAgePersonsNumber': False, 'malePersonsNumber': False, 'femalePersonsNumber': False, 'educationLevel': { 'edu_prim': False, 'edu_sec': False, 'edu_uni': False, 'edu_noStudies': False } } )
def test__get_building_details(self): contract = Contract(self.contract_id) building = contract.buildingDetails self.assertDictEqual( building, { 'buildingConstructionYear': 1999, 'dwellingArea': 89, 'propertyType': False, 'buildingType': 'Apartment', 'dwellingPositionInBuilding': False, 'dwellingOrientation': False, 'buildingWindowsType': False, 'buildingWindowsFrame': '', 'buildingCoolingSource': False, 'buildingHeatingSource': 'other', 'buildingHeatingSourceDhw': False, 'buildingSolarSystem': False } )
def test__create_invoice(self): contract = Contract(self.contract_id) self.assertIsInstance(contract, Contract)