@@ -34,7 +34,7 @@ def _core(self, dataset, opts={}, class_mappings=[]):
34
34
def test_type_conversion (self ):
35
35
reclass = self ._core ('01' )
36
36
node = reclass .nodeinfo ('data_types' )
37
- params = { 'int' : 1 , 'bool' : True , 'string' : '1' , '_reclass_' : { 'environment' : 'base' , 'name' : {'full' : 'data_types' , 'short' : 'data_types' } } }
37
+ params = { 'int' : 1 , 'bool' : True , 'string' : '1' , '_reclass_' : { 'environment' : 'base' , 'name' : {'full' : 'data_types' , 'parts' : [ 'data_types' ], 'path' : 'data_types' , ' short' : 'data_types' } } }
38
38
self .assertEqual (node ['parameters' ], params )
39
39
40
40
def test_raise_class_notfound (self ):
@@ -45,7 +45,7 @@ def test_raise_class_notfound(self):
45
45
def test_ignore_class_notfound (self ):
46
46
reclass = self ._core ('01' , opts = { 'ignore_class_notfound' : True , 'ignore_class_notfound_warning' : False })
47
47
node = reclass .nodeinfo ('class_notfound' )
48
- params = { 'node_test' : 'class not found' , '_reclass_' : { 'environment' : 'base' , 'name' : {'full' : 'class_notfound' , 'short' : 'class_notfound' } } }
48
+ params = { 'node_test' : 'class not found' , '_reclass_' : { 'environment' : 'base' , 'name' : {'full' : 'class_notfound' , 'parts' : [ 'class_notfound' ], 'path' : 'class_notfound' , ' short' : 'class_notfound' } } }
49
49
self .assertEqual (node ['parameters' ], params )
50
50
51
51
def test_raise_class_notfound_with_regexp (self ):
@@ -56,31 +56,31 @@ def test_raise_class_notfound_with_regexp(self):
56
56
def test_ignore_class_notfound_with_regexp (self ):
57
57
reclass = self ._core ('01' , opts = { 'ignore_class_notfound' : True , 'ignore_class_notfound_warning' : False , 'ignore_class_notfound_regexp' : 'miss.*' })
58
58
node = reclass .nodeinfo ('class_notfound' )
59
- params = { 'node_test' : 'class not found' , '_reclass_' : { 'environment' : 'base' , 'name' : {'full' : 'class_notfound' , 'short' : 'class_notfound' } } }
59
+ params = { 'node_test' : 'class not found' , '_reclass_' : { 'environment' : 'base' , 'name' : {'full' : 'class_notfound' , 'parts' : [ 'class_notfound' ], 'path' : 'class_notfound' , ' short' : 'class_notfound' } } }
60
60
self .assertEqual (node ['parameters' ], params )
61
61
62
62
def test_relative_class_names (self ):
63
63
reclass = self ._core ('02' )
64
64
node = reclass .nodeinfo ('relative' )
65
- params = { 'test1' : 1 , 'test2' : 2 , 'test3' : 3 , 'test4' : 4 , 'test5' : 5 , 'one_beta' : 1 , 'two_beta' : 2 , 'four_alpha' : 3 , 'two_gamma' : 4 , 'alpha_init' : 5 , '_reclass_' : { 'environment' : 'base' , 'name' : { 'full' : 'relative' , 'short' : 'relative' } } }
65
+ params = { 'test1' : 1 , 'test2' : 2 , 'test3' : 3 , 'test4' : 4 , 'test5' : 5 , 'one_beta' : 1 , 'two_beta' : 2 , 'four_alpha' : 3 , 'two_gamma' : 4 , 'alpha_init' : 5 , '_reclass_' : { 'environment' : 'base' , 'name' : { 'full' : 'relative' , 'parts' : [ 'relative' ], 'path' : 'relative' , ' short' : 'relative' } } }
66
66
self .assertEqual (node ['parameters' ], params )
67
67
68
68
def test_top_relative_class_names (self ):
69
69
reclass = self ._core ('02' )
70
70
node = reclass .nodeinfo ('top_relative' )
71
- params = { 'test1' : 1 , 'test2' : 2 , 'test3' : 3 , 'test4' : 4 , 'test5' : 5 , 'one_beta' : 1 , 'two_beta' : 2 , 'four_alpha' : 3 , 'two_gamma' : 4 , 'alpha_init' : 5 , '_reclass_' : { 'environment' : 'base' , 'name' : { 'full' : 'top_relative' , 'short' : 'top_relative' } } }
71
+ params = { 'test1' : 1 , 'test2' : 2 , 'test3' : 3 , 'test4' : 4 , 'test5' : 5 , 'one_beta' : 1 , 'two_beta' : 2 , 'four_alpha' : 3 , 'two_gamma' : 4 , 'alpha_init' : 5 , '_reclass_' : { 'environment' : 'base' , 'name' : { 'full' : 'top_relative' , 'parts' : [ 'top_relative' ], 'path' : 'top_relative' , ' short' : 'top_relative' } } }
72
72
self .assertEqual (node ['parameters' ], params )
73
73
74
74
def test_compose_node_names (self ):
75
75
reclass = self ._core ('03' , opts = {'compose_node_name' : True })
76
76
alpha_one_node = reclass .nodeinfo ('alpha.one' )
77
- alpha_one_res = {'a' : 1 , 'alpha' : [1 , 2 ], 'beta' : {'a' : 1 , 'b' : 2 }, 'b' : 2 , '_reclass_' : {'environment' : 'base' , 'name' : {'full' : 'alpha.one' , 'short ' : 'alpha' }}}
77
+ alpha_one_res = {'a' : 1 , 'alpha' : [1 , 2 ], 'beta' : {'a' : 1 , 'b' : 2 }, 'b' : 2 , '_reclass_' : {'environment' : 'base' , 'name' : {'full' : 'alpha.one' , 'parts ' : [ 'alpha' , 'one' ], 'path' : 'alpha/one' , 'short' : 'one ' }}}
78
78
alpha_two_node = reclass .nodeinfo ('alpha.two' )
79
- alpha_two_res = {'a' : 1 , 'alpha' : [1 , 3 ], 'beta' : {'a' : 1 , 'c' : 3 }, 'c' : 3 , '_reclass_' : {'environment' : 'base' , 'name' : {'full' : 'alpha.two' , 'short ' : 'alpha' }}}
79
+ alpha_two_res = {'a' : 1 , 'alpha' : [1 , 3 ], 'beta' : {'a' : 1 , 'c' : 3 }, 'c' : 3 , '_reclass_' : {'environment' : 'base' , 'name' : {'full' : 'alpha.two' , 'parts ' : [ 'alpha' , 'two' ], 'path' : 'alpha/two' , 'short' : 'two ' }}}
80
80
beta_one_node = reclass .nodeinfo ('beta.one' )
81
- beta_one_res = {'alpha' : [2 , 3 ], 'beta' : {'c' : 3 , 'b' : 2 }, 'b' : 2 , 'c' : 3 , '_reclass_' : {'environment' : 'base' , 'name' : {'full' : 'beta.one' , 'short ' : 'beta' }}}
81
+ beta_one_res = {'alpha' : [2 , 3 ], 'beta' : {'c' : 3 , 'b' : 2 }, 'b' : 2 , 'c' : 3 , '_reclass_' : {'environment' : 'base' , 'name' : {'full' : 'beta.one' , 'parts ' : [ 'beta' , 'one' ], 'path' : 'beta/one' , 'short' : 'one ' }}}
82
82
beta_two_node = reclass .nodeinfo ('beta.two' )
83
- beta_two_res = {'alpha' : [3 , 4 ], 'c' : 3 , 'beta' : {'c' : 3 , 'd' : 4 }, 'd' : 4 , '_reclass_' : {'environment' : u'base' , 'name' : {'full' : u'beta.two' , 'short' : u'beta ' }}}
83
+ beta_two_res = {'alpha' : [3 , 4 ], 'c' : 3 , 'beta' : {'c' : 3 , 'd' : 4 }, 'd' : 4 , '_reclass_' : {'environment' : u'base' , 'name' : {'full' : u'beta.two' , 'parts' : [ 'beta' , 'two' ], 'path' : 'beta/two' , ' short' : u'two ' }}}
84
84
self .assertEqual (alpha_one_node ['parameters' ], alpha_one_res )
85
85
self .assertEqual (alpha_two_node ['parameters' ], alpha_two_res )
86
86
self .assertEqual (beta_one_node ['parameters' ], beta_one_res )
@@ -89,13 +89,13 @@ def test_compose_node_names(self):
89
89
def test_class_mappings_match_path_false (self ):
90
90
reclass = self ._core ('04' , opts = {'class_mappings_match_path' : False }, class_mappings = ['node* two' , 'alpha/node* three' ])
91
91
node = reclass .nodeinfo ('node1' )
92
- params = { 'test1' : 1 , 'test2' : 2 , '_reclass_' : {'environment' : u'base' , 'name' : {'full' : 'node1' , 'short' : 'node1' }}}
92
+ params = { 'test1' : 1 , 'test2' : 2 , '_reclass_' : {'environment' : u'base' , 'name' : {'full' : 'node1' , 'parts' : [ 'node1' ], 'path' : 'node1' , ' short' : 'node1' }}}
93
93
self .assertEqual (node ['parameters' ], params )
94
94
95
95
def test_class_mappings_match_path_true (self ):
96
96
reclass = self ._core ('04' , opts = {'class_mappings_match_path' : True }, class_mappings = ['node* two' , 'alpha/node* three' ])
97
97
node = reclass .nodeinfo ('node1' )
98
- params = { 'test1' : 1 , 'test3' : 3 , '_reclass_' : {'environment' : u'base' , 'name' : {'full' : 'node1' , 'short' : 'node1' }}}
98
+ params = { 'test1' : 1 , 'test3' : 3 , '_reclass_' : {'environment' : u'base' , 'name' : {'full' : 'node1' , 'parts' : [ 'node1' ], 'path' : 'node1' , ' short' : 'node1' }}}
99
99
self .assertEqual (node ['parameters' ], params )
100
100
101
101
def test_merging_of_parameters_before_class_interpolation_enabling_overrides (self ):
0 commit comments