# 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/sensors/accelerometer.py
# class Accelerometer(Object):
#     """An object able to measure accelerations that are applied to it.
#     """
# 
#     def __init__(self, name):
#         super().__init__(name)
#         self._mass_object = Shape('%s_mass' % (self.get_name()))
#         self._sensor = ForceSensor('%s_force_sensor' % (self.get_name()))
# 
#     def _get_requested_type(self) -> ObjectType:
#         return ObjectType(sim.simGetObjectType(self.get_handle()))
# 
#     def read(self) -> List[float]:
#         """Reads the acceleration applied to accelerometer.
# 
#         :return: A list containing applied accelerations along
#             the sensor's x, y and z-axes
#         """
#         forces, _ = self._sensor.read()
#         accel = [force / self._mass_object.get_mass() for force in forces]
#         return accel


import unittest
from tests.core import TestCore
from pyrep.sensors.accelerometer import Accelerometer


class TestAccelerometer(TestCore):

    def setUp(self):
        super().setUp()

# 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/sensors/accelerometer.py
# class Accelerometer(Object):
#     """An object able to measure accelerations that are applied to it.
#     """
# 
#     def __init__(self, name):
#         super().__init__(name)
#         self._mass_object = Shape('%s_mass' % (self.get_name()))
#         self._sensor = ForceSensor('%s_force_sensor' % (self.get_name()))
# 
#     def _get_requested_type(self) -> ObjectType:
#         return ObjectType(sim.simGetObjectType(self.get_handle()))
# 
#     def read(self) -> List[float]:
#         """Reads the acceleration applied to accelerometer.
# 
#         :return: A list containing applied accelerations along
#             the sensor's x, y and z-axes
#         """
#         forces, _ = self._sensor.read()
#         accel = [force / self._mass_object.get_mass() for force in forces]
#         return accel


# Path: tests/test_accelerometer.py
import unittest
from tests.core import TestCore
from pyrep.sensors.accelerometer import Accelerometer



class TestAccelerometer(TestCore):

    def setUp(self):
        super().setUp()

        self.sensor = Accelerometer('accelerometer')