File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 22# Licensed under the 2-Clause BSD License, see LICENSE for details.
33# SPDX-License-Identifier: BSD-2-Clause
44
5+ import os
56import os .path
67import tempfile
78
@@ -84,3 +85,24 @@ def test_config_libraries():
8485 assert lib .location == os .path .join (library_root , "test_lib" )
8586 assert lib .sync_uri == "https://github.com/fusesoc/fusesoc-cores"
8687 assert not lib .auto_sync
88+
89+
90+ def test_config_write ():
91+ tcf = tempfile .NamedTemporaryFile (mode = "w+" , delete = False )
92+ tcf .write (
93+ EXAMPLE_CONFIG .format (
94+ build_root = build_root ,
95+ cache_root = cache_root ,
96+ cores_root = cores_root ,
97+ library_root = library_root ,
98+ )
99+ )
100+ tcf .flush ()
101+
102+ with Config (tcf .name ) as c :
103+ c .build_root = "/tmp"
104+
105+ conf = Config (tcf .name )
106+
107+ assert conf .build_root == "/tmp"
108+ os .remove (tcf .name )
You can’t perform that action at this time.
0 commit comments