deftinc / feature_gate

MIT License
0 stars 2 forks source link

Add test case for Posthog Rate Limiting #13

Open thephw opened 1 month ago

thephw commented 1 month ago

Description

We need to add a test case for a rate limiting response from posthog to see if #is_enabled returns a valid value.

thephw commented 1 month ago

@vinbarnes Yev is going to add the test response from Posthog here so we can add it to the test suite.

prontsevychev commented 1 month ago

@vinbarnes Here is throttled error data:

response.status_code == 429
response.json() == {
    'type': 'throttled_error',
    'code': 'throttled',
    'detail': 'Request was throttled. Expected available in 5 seconds.',
    'attr': None
}

Seconds were different, from 1 to 5, btw.