fix(litellm): gate OAuth routes on real credentials
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import unittest
|
||||
from render_config import build_config
|
||||
from pathlib import Path
|
||||
from tempfile import TemporaryDirectory
|
||||
from render_config import build_config, oauth_ready
|
||||
|
||||
|
||||
class ConfigTests(unittest.TestCase):
|
||||
@@ -33,6 +35,15 @@ class ConfigTests(unittest.TestCase):
|
||||
self.assertTrue(routes[0]['litellm_params']['use_xai_oauth'])
|
||||
self.assertNotIn('api_key', routes[0]['litellm_params'])
|
||||
|
||||
def test_pending_oauth_is_not_ready(self):
|
||||
with TemporaryDirectory() as folder:
|
||||
path = Path(folder) / 'auth.json'
|
||||
self.assertFalse(oauth_ready(path))
|
||||
path.write_text('{"device_code_requested_at": 1}')
|
||||
self.assertFalse(oauth_ready(path))
|
||||
path.write_text('{"access_token": "fixture-only"}')
|
||||
self.assertTrue(oauth_ready(path))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user