def test_nativeToLogical_None(self): """Test passing None to the nativeToLogical method.""" unit = AxisPosition(1, 2, 3, True, 4) # 1 - (2 + 3) = -4 ; -4 / 4 = -1 result = unit.nativeToLogical(None) self.assertEqual(result, -1, "The result should be -1") unit.setAbsoluteMode(False) result = unit.nativeToLogical(None) self.assertEqual(result, -1, "The result should be -1") result = unit.nativeToLogical(None, True) self.assertEqual(result, -1, "The result should be -1") result = unit.nativeToLogical(None, False) self.assertEqual(result, -1, "The result should be -1")
def test_nativeToLogical_Relative(self): """Test the nativeToLogical method when in relative mode.""" unit = AxisPosition(1, 2, 3, False, 4) result = unit.nativeToLogical(41) self.assertEqual(result, 10, "The result should be 10")
def test_nativeToLogical_Absolute(self): """Test the nativeToLogical method when in absolute mode.""" unit = AxisPosition(1, 2, 3, True, 4) result = unit.nativeToLogical(45) self.assertEqual(result, 10, "The result should be 10")
def test_nativeToLogical_RelativeParam(self): """Test the nativeToLogical method overriding absolute mode.""" unit = AxisPosition(1, 2, 3, True, 4) result = unit.nativeToLogical(41, False) self.assertEqual(result, 10, "The result should be 10")