Skip to content

Commit

Permalink
Merge pull request #413 from agri-gaia/fix/tests-polygon-sensor-position
Browse files Browse the repository at this point in the history
fix: tests with regards to the polygonSensorPosition field in the query
  • Loading branch information
Mark-Niemeyer authored Sep 11, 2024
2 parents 836903d + ebf6a35 commit 1e68cbd
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions tests/python/gRPC/util/msg_abs/msgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

class EnumFbQuery(FrozenEnum):
POLYGON = auto() # def: None
POLYGONSENSORPOSITION = auto() # def: None
FULLY_ENCAPSULATED = auto() # def: False
IN_MAP_FRAME = auto() # def: True
TIMEINTERVAL = auto() # def: None
Expand All @@ -52,6 +53,11 @@ def _set_enum_func_mapping(self) -> Dict[EnumFbQuery, MsgsFunctions]:
EnumFbQuery.POLYGON: MsgsFunctions(
lambda: None, lambda: Dtypes.Fb.polygon2d(self.builder)
),
EnumFbQuery.POLYGONSENSORPOSITION: MsgsFunctions(
# TODO provide a example polygon, differing from POLYGON
lambda: None,
lambda: Dtypes.Fb.polygon2d(self.builder),
),
EnumFbQuery.FULLY_ENCAPSULATED: MsgsFunctions(
lambda: False, lambda: True
),
Expand Down Expand Up @@ -109,6 +115,9 @@ def datauuid(self) -> List[int]:

def _assemble_datatype_instance(self):
polygon = self.get_component(EnumFbQuery.POLYGON)
polygon_sensor_position = self.get_component(
EnumFbQuery.POLYGONSENSORPOSITION
)
fully_encapsulated = self.get_component(EnumFbQuery.FULLY_ENCAPSULATED)
in_map_frame = self.get_component(EnumFbQuery.IN_MAP_FRAME)
timeinterval = self.get_component(EnumFbQuery.TIMEINTERVAL)
Expand All @@ -124,17 +133,18 @@ def _assemble_datatype_instance(self):

return fbh.createQuery(
self.builder,
timeinterval,
label,
must_have_all_labels,
projectuuid,
instanceuuid,
datauuid,
withoutdata,
polygon,
fully_encapsulated,
in_map_frame,
sort_by_time,
timeInterval=timeinterval,
labels=label,
mustHaveAllLabels=must_have_all_labels,
projectUuids=projectuuid,
instanceUuids=instanceuuid,
dataUuids=datauuid,
withoutData=withoutdata,
polygon2d=polygon,
polygon2dSensorPos=polygon_sensor_position,
fullyEncapsulated=fully_encapsulated,
inMapFrame=in_map_frame,
sortByTime=sort_by_time,
)


Expand Down Expand Up @@ -163,10 +173,9 @@ def _assemble_datatype_instance(self):
datatype = self.get_component(EnumFbQueryInstance.DATATYPE)
query = self.get_component(EnumFbQueryInstance.QUERY)

QueryInstance.Start(self.builder)
QueryInstance.AddDatatype(self.builder, datatype)
QueryInstance.AddQuery(self.builder, query)
return QueryInstance.End(self.builder)
return fbh.createQueryInstance(
self.builder, datatype=datatype, query=query
)


class DatatypeImplementations:
Expand Down

0 comments on commit 1e68cbd

Please sign in to comment.