File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,11 @@ class GraphConfig:
112112
113113 _PATH_MODIFIED = False
114114
115+ def __post_init__ (self ):
116+ # ensure we have an absolute path; this is required for assumptions
117+ # made later, such as the `vcs_root` being a directory above `root_dir`
118+ object .__setattr__ (self , "root_dir" , os .path .abspath (self .root_dir ))
119+
115120 def __getitem__ (self , name ):
116121 return self ._config [name ]
117122
Original file line number Diff line number Diff line change 22# License, v. 2.0. If a copy of the MPL was not distributed with this
33# file, You can obtain one at http://mozilla.org/MPL/2.0/.
44
5+ import os .path
6+
57import pytest
68
79from taskgraph .config import GraphConfig
1012def test_graph_config_basic ():
1113 graph_config = GraphConfig ({"foo" : "bar" }, "root" )
1214
15+ assert os .path .isabs (graph_config .root_dir )
16+
1317 assert "foo" in graph_config
1418 assert graph_config ["foo" ] == "bar"
1519 assert graph_config .get ("foo" ) == "bar"
You can’t perform that action at this time.
0 commit comments