def test_record_not_found(mocker): with pytest.raises(RecordNotFound): from console.services.app_actions.properties_changes import PropertiesChanges service_source = ServiceSourceInfo() service_source.group_key = "dummy group_key" mocker.patch( "console.repositories.app.service_source_repo.get_service_source", return_value=service_source) properties_changes = PropertiesChanges(TenantServiceInfo()) properties_changes.get_property_changes("eid", "version")
def test_rbd_app_not_found(mocker): from console.services.app_actions.properties_changes import PropertiesChanges with open("{}/tests/console/svcupgrade/app_template.json".format(settings.BASE_DIR)) as json_file: app_template = json.load(json_file) rain_app = RainbondCenterApp() rain_app.app_template = json.dumps(app_template) mocker.patch("console.repositories.market_app_repo.rainbond_app_repo.get_enterpirse_app_by_key_and_version", return_value=rain_app) service_source = ServiceSourceInfo() service_source.group_key = "dummy group_key" mocker.patch("console.repositories.app.service_source_repo.get_service_source", return_value=service_source) with pytest.raises(RbdAppNotFound): properties_changes = PropertiesChanges(TenantServiceInfo(), Tenants()) properties_changes.get_property_changes("eid", "version")