# Path: tests/core.py
# class TestCore(unittest.TestCase):
# 
#     def setUp(self):
#         self.pyrep = PyRep()
#         self.pyrep.launch(path.join(ASSET_DIR, 'test_scene.ttt'), headless=True)
#         self.pyrep.step()
#         self.pyrep.start()
# 
#     def tearDown(self):
#         self.pyrep.stop()
#         self.pyrep.step_ui()
#         self.pyrep.shutdown()
# 
# Path: pyrep/objects/force_sensor.py
# class ForceSensor(Object):
#     """An object able to measure forces and torques that are applied to it.
#     """
# 
#     def _get_requested_type(self) -> ObjectType:
#         return ObjectType.FORCE_SENSOR
# 
#     @classmethod
#     def create(cls, sensor_size=0.01) -> 'ForceSensor':
#         options = 0  # force and torque threshold are disabled
#         intParams = [0, 0, 0, 0, 0]
#         floatParams = [sensor_size, 0, 0, 0, 0]
#         handle = sim.simCreateForceSensor(options=0, intParams=intParams,
#                                           floatParams=floatParams, color=None)
#         return cls(handle)
# 
#     def read(self) -> Tuple[List[float], List[float]]:
#         """Reads the force and torque applied to a force sensor.
# 
#         :return: A tuple containing the applied forces along the
#             sensor's x, y and z-axes, and the torques along the
#             sensor's x, y and z-axes.
#         """
#         _, forces, torques = sim.simReadForceSensor(self._handle)
#         return forces, torques


import unittest
from tests.core import TestCore
from pyrep.objects.force_sensor import ForceSensor


class TestForceSensors(TestCore):

    def setUp(self):
        super().setUp()
        self.sensor = ForceSensor('force_sensor')

    def test_read(self):
        force_vector, torque_vector = self.sensor.read()
        self.assertEqual(len(force_vector), 3)
        self.assertEqual(len(torque_vector), 3)

    def test_create(self):

# Path: tests/core.py
# class TestCore(unittest.TestCase):
# 
#     def setUp(self):
#         self.pyrep = PyRep()
#         self.pyrep.launch(path.join(ASSET_DIR, 'test_scene.ttt'), headless=True)
#         self.pyrep.step()
#         self.pyrep.start()
# 
#     def tearDown(self):
#         self.pyrep.stop()
#         self.pyrep.step_ui()
#         self.pyrep.shutdown()
# 
# Path: pyrep/objects/force_sensor.py
# class ForceSensor(Object):
#     """An object able to measure forces and torques that are applied to it.
#     """
# 
#     def _get_requested_type(self) -> ObjectType:
#         return ObjectType.FORCE_SENSOR
# 
#     @classmethod
#     def create(cls, sensor_size=0.01) -> 'ForceSensor':
#         options = 0  # force and torque threshold are disabled
#         intParams = [0, 0, 0, 0, 0]
#         floatParams = [sensor_size, 0, 0, 0, 0]
#         handle = sim.simCreateForceSensor(options=0, intParams=intParams,
#                                           floatParams=floatParams, color=None)
#         return cls(handle)
# 
#     def read(self) -> Tuple[List[float], List[float]]:
#         """Reads the force and torque applied to a force sensor.
# 
#         :return: A tuple containing the applied forces along the
#             sensor's x, y and z-axes, and the torques along the
#             sensor's x, y and z-axes.
#         """
#         _, forces, torques = sim.simReadForceSensor(self._handle)
#         return forces, torques


# Path: tests/test_force_sensors.py
import unittest
from tests.core import TestCore
from pyrep.objects.force_sensor import ForceSensor



class TestForceSensors(TestCore):

    def setUp(self):
        super().setUp()
        self.sensor = ForceSensor('force_sensor')

    def test_read(self):
        force_vector, torque_vector = self.sensor.read()
        self.assertEqual(len(force_vector), 3)
        self.assertEqual(len(torque_vector), 3)

    def test_create(self):

        sensor = ForceSensor.create()