How to use the groupy.api.endpoint.Endpoint.clamp function in groupy

To help you get started, we’ve selected a few groupy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rhgrant10 / Groupy / tests / test_endpoint.py View on Github external
def test_value_is_more_than_upper_produces_upper(self):
        lower, value, upper = 1, 3, 2
        result = endpoint.Endpoint.clamp(value, lower=lower, upper=upper)
        self.assertEqual(result, upper)
github rhgrant10 / Groupy / tests / test_endpoint.py View on Github external
def test_value_lower_and_upper_are_zero(self):
        result = endpoint.Endpoint.clamp(0, lower=0, upper=0)
        self.assertEqual(result, 0)
github rhgrant10 / Groupy / tests / test_endpoint.py View on Github external
def test_value_lower_and_upper_are_negative(self):
        result = endpoint.Endpoint.clamp(-1, lower=-1, upper=-1)
        self.assertEqual(result, -1)
github rhgrant10 / Groupy / tests / test_endpoint.py View on Github external
def test_value_is_least_produces_given_lower(self):
        lower, upper, value = 3, 2, 1
        result = endpoint.Endpoint.clamp(value, lower=lower, upper=upper)
        self.assertEqual(result, lower)
github rhgrant10 / Groupy / tests / test_endpoint.py View on Github external
def test_value_is_greatest_produces_given_lower(self):
        value, lower, upper = 3, 2, 1
        result = endpoint.Endpoint.clamp(value, lower=lower, upper=upper)
        self.assertEqual(result, lower)
github rhgrant10 / Groupy / tests / test_endpoint.py View on Github external
def test_value_is_less_than_lower_produces_lower(self):
        lower, value, upper = 2, 1, 3
        result = endpoint.Endpoint.clamp(value, lower=lower, upper=upper)
        self.assertEqual(result, lower)
github rhgrant10 / Groupy / tests / test_endpoint.py View on Github external
def test_value_lower_and_upper_are_positive(self):
        result = endpoint.Endpoint.clamp(1, lower=1, upper=1)
        self.assertEqual(result, 1)
github rhgrant10 / Groupy / tests / test_endpoint.py View on Github external
def test_value_between_lower_and_upper_produces_given_lower(self):
        lower, value, upper = 3, 2, 1
        result = endpoint.Endpoint.clamp(value, lower=lower, upper=upper)
        self.assertEqual(result, lower)
github rhgrant10 / Groupy / tests / test_endpoint.py View on Github external
def test_value_between_lower_and_upper_produces_value(self):
        lower, value, upper = 1, 2, 3
        result = endpoint.Endpoint.clamp(value, lower=lower, upper=upper)
        self.assertEqual(result, value)