Removed the jenkins replace with cerc

This commit is contained in:
Ruben Sanchez 2023-11-20 11:10:22 -05:00
parent 60e1686421
commit 404f8d561d
2 changed files with 12 additions and 22 deletions

View File

@ -46,7 +46,7 @@ class Control:
"""
self._skip_test = False
# Create test database
dotenv_path = Path("{}/.local/etc/hub_api/.env".format(os.path.expanduser('~').replace('jenkins', 'cerc'))).resolve()
dotenv_path = Path("{}/.local/etc/hub/.env".format(os.path.expanduser('~'))).resolve()
if not dotenv_path.exists():
self._skip_test = True
self._skip_reason = f'.env file missing at {dotenv_path}'
@ -106,19 +106,13 @@ class Control:
self._application_uuid = 'b9e0ce80-1218-410c-8a64-9d9b7026aad8'
self._application_id = 1
self._user_id = 1
try:
self._application_id = self._database.persist_application(
'test',
'test',
self.application_uuid
)
except sqlalchemy.exc.SQLAlchemyError:
self._application_id = self._database.application_info(self.application_uuid).id
try:
self._user_id = self._database.create_user('test', self._application_id, 'test', UserRoles.Admin)
except sqlalchemy.exc.SQLAlchemyError:
self._user_id = self._database.user_info(name='test', password='test', application_id=self._application_id).id
self._pickle_path = Path('tests_data/pickle_path.bz2').resolve()
@ -279,10 +273,8 @@ TestDBFactory
{'yearly_cooling_consumption': yearly_cooling_consumption},
{'monthly_domestic_hot_water_consumption': monthly_domestic_hot_water_consumption},
{'yearly_domestic_hot_water_consumption': yearly_domestic_hot_water_consumption},
{
'monthly_distribution_systems_electrical_consumption': monthly_distribution_systems_electrical_consumption},
{
'yearly_distribution_systems_electrical_consumption': yearly_distribution_systems_electrical_consumption},
{'monthly_distribution_systems_electrical_consumption': monthly_distribution_systems_electrical_consumption},
{'yearly_distribution_systems_electrical_consumption': yearly_distribution_systems_electrical_consumption},
{'monthly_on_site_electrical_production': monthly_on_site_electrical_production},
{'yearly_on_site_electrical_production': yearly_on_site_electrical_production}
]})
@ -304,6 +296,3 @@ TestDBFactory
control.database.delete_application(control.application_uuid)
control.database.delete_user(control.user_id)
os.unlink(control.pickle_path)
output_files = glob.glob('./tests_outputs/*')
for output_file in output_files:
os.unlink(output_file)

View File

@ -129,6 +129,7 @@ class TestDBFactory(TestCase):
"skin and system retrofit with pv": ["01002777", "01002773", "01036804"]
}
]
}
results = control.database.results(control.user_id, control.application_id, request_values)