Skip to content

Commit

Permalink
ensure settings can be serialized
Browse files Browse the repository at this point in the history
  • Loading branch information
shyamd committed Mar 10, 2021
1 parent d15c7c0 commit 15e5c28
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/emmet-core/test_settings.py
Expand Up @@ -4,6 +4,8 @@
from random import random

from emmet.core.settings import EmmetSettings
from monty.serialization import loadfn, dumpfn
from monty.tempfile import ScratchDir


def test_default_config_path(tmp_path: PosixPath):
Expand Down Expand Up @@ -40,3 +42,14 @@ def test_from_url():
test_config = EmmetSettings()

assert test_config.ANGLE_TOL == 1.0


def test_seriallization():

test_config = EmmetSettings()

with ScratchDir("."):
dumpfn(test_config, "test.json")
reload_config = loadfn("test.json")

assert isinstance(reload_config, EmmetSettings)

0 comments on commit 15e5c28

Please sign in to comment.