feat: add privacy router and zero-cost safeguards
This commit is contained in:
@@ -34,6 +34,33 @@ class SettingsTests(unittest.TestCase):
|
||||
}
|
||||
)
|
||||
|
||||
def test_zero_cost_defaults_are_conservative(self) -> None:
|
||||
settings = Settings.from_env({"JAVIS_DATA_DIR": str(Path.cwd())})
|
||||
|
||||
self.assertTrue(settings.free_only)
|
||||
self.assertFalse(settings.gemini_enabled)
|
||||
self.assertFalse(settings.billing_confirmed_disabled)
|
||||
self.assertEqual(settings.gemini_model, "gemini-3.6-flash")
|
||||
self.assertEqual(settings.provider_mode, "auto")
|
||||
|
||||
def test_paid_mode_is_rejected(self) -> None:
|
||||
with self.assertRaises(ConfigurationError):
|
||||
Settings.from_env(
|
||||
{
|
||||
"JAVIS_DATA_DIR": str(Path.cwd()),
|
||||
"JAVIS_FREE_ONLY": "false",
|
||||
}
|
||||
)
|
||||
|
||||
def test_cloud_limits_are_bounded(self) -> None:
|
||||
with self.assertRaises(ConfigurationError):
|
||||
Settings.from_env(
|
||||
{
|
||||
"JAVIS_DATA_DIR": str(Path.cwd()),
|
||||
"JAVIS_MAX_CLOUD_REQUESTS_PER_DAY": "1001",
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user