def test_get_last_output_files_for_entity(self): geometry = self.output_type cache = self.generate_fixture_output_type(name="Cache", short_name="cch") self.generate_fixture_output_file(geometry, 2) self.generate_fixture_output_file(geometry, 3) self.generate_fixture_output_file(geometry, 4) geometry_file = self.generate_fixture_output_file(geometry, 5) self.generate_fixture_output_file(cache, 1) self.generate_fixture_output_file(cache, 2) cache_file = self.generate_fixture_output_file(cache, 3) last_output_files = files_service.get_last_output_files_for_entity( self.asset.id) # test last geometry file revision last_file = [ f for f in last_output_files if (f["output_type_id"] == str(geometry.id) and f["name"] == geometry_file.name) ][0] self.assertEqual(last_file["revision"], 5) # test last cache file revision last_file = [ f for f in last_output_files if (f["output_type_id"] == str(cache.id) and f["name"] == cache_file.name) ][0] self.assertEqual(last_file["revision"], 3)
def get(self, entity_id): entity = entities_service.get_entity(entity_id) user_service.check_project_access(entity["project_id"]) return files_service.get_last_output_files_for_entity( entity["id"], output_type_id=request.args.get("output_type_id", None), task_type_id=request.args.get("task_type_id", None), representation=request.args.get("representation", None), )
def get(self, entity_id): entity = entities_service.get_entity(entity_id) user_service.check_project_access(entity["project_id"]) return files_service.get_last_output_files_for_entity( entity["id"], output_type_id=request.args.get("output_type_id", None), task_type_id=request.args.get("task_type_id", None), representation=request.args.get("representation", None), file_status_id=request.args.get("file_status_id", None), created_at_since=request.args.get("created_at_since", None), person_id=request.args.get("person_id", None), )
def test_get_last_output_files_for_entity(self): geometry = self.output_type cache = self.generate_fixture_output_type(name="Cache", short_name="cch") self.generate_fixture_output_file(geometry, 2) self.generate_fixture_output_file(geometry, 3) self.generate_fixture_output_file(geometry, 4) geometry_file = self.generate_fixture_output_file(geometry, 5) self.generate_fixture_output_file(cache, 1) self.generate_fixture_output_file(cache, 2) cache_file = self.generate_fixture_output_file(cache, 3) last_output_files = files_service.get_last_output_files_for_entity( self.asset.id) self.assertEquals( last_output_files[str( geometry.id)][geometry_file.name]["revision"], 5) self.assertEquals( last_output_files[str(cache.id)][cache_file.name]["revision"], 3)
def get(self, entity_id): entity = entities_service.get_entity(entity_id) user_service.check_project_access(entity["project_id"]) return files_service.get_last_output_files_for_entity(entity["id"])
def get(self, entity_id): entity = entities_service.get_entity(entity_id) if not permissions.has_manager_permissions(): user_service.check_has_task_related(entity["project_id"]) return files_service.get_last_output_files_for_entity(entity["id"])