Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

test: user config (#106)

Akshay Agrawal6fcbb5721883
diff --git a/marimo/_config/test_config.py b/marimo/_config/test_config.py
new file mode 100644
index 0000000000..6e33f86132
--- /dev/null
+++ b/marimo/_config/test_config.py
@@ -0,0 +1,25 @@
+# Copyright 2023 Marimo. All rights reserved.
+from marimo._config.config import DEFAULT_CONFIG, MarimoConfig, configure
+
+
+def assert_config(override: MarimoConfig) -> None:
+ user_config = configure(override)
+ assert user_config == {**DEFAULT_CONFIG, **override}
+
+
+def test_configure_partial_keymap() -> None:
+ assert_config(MarimoConfig(keymap={"preset": "vim"}))
+
+
+def test_configure_full() -> None:
+ assert_config(
+ MarimoConfig(
+ completion={"activate_on_typing": False},
+ save={"autosave": "after_delay", "autosave_delay": 2},
+ keymap={"preset": "vim"},
+ )
+ )
+
+
+def test_configure_unknown() -> None:
+ assert_config({"super cool future config key": {"secret": "value"}}) # type: ignore[typeddict-unknown-key] # noqa: E501