Skip to content

Commit

Permalink
Add a test for add and describe
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamHPNielsen committed Nov 29, 2018
1 parent d573602 commit a697e24
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions qcodes/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,3 +336,27 @@ def test_repr():
f"{super(Config, cfg).__repr__()}")

assert rep == expected_rep


def test_add_and_describe():
"""
Test that a key an be added and described
"""
with default_config():

key = 'newkey'
value ='testvalue'
value_type ='string'
description ='A test'
default = 'testdefault'

cfg = Config()
cfg.add(key=key, value=value, value_type=value_type,
description=description, default=default)


desc = cfg.describe(f'user.{key}')
expected_desc = (f"{description}.\nCurrent value: {value}. "
f"Type: {value_type}. Default: {default}.")

assert desc == expected_desc

0 comments on commit a697e24

Please sign in to comment.