This repository was archived by the owner on Aug 26, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +46
-2
lines changed Expand file tree Collapse file tree 3 files changed +46
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [ Unreleased]
9
9
10
+ # [ 1.1.0]
11
+
12
+ ## Added
13
+
14
+ - proxy raw dict methods in ` TerraformValueDict `
15
+
10
16
## [ 1.0.1]
11
17
12
18
## Changed
@@ -35,6 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
35
41
- remove the ` teardown ` method
36
42
- unify the ` plan ` and ` plan_out ` methods
37
43
38
- [ Unreleased ] : https://github.com/GoogleCloudPlatform/terraform-python-testing-helper/compare/v4.0.0...HEAD
44
+ [ Unreleased ] : https://github.com/GoogleCloudPlatform/terraform-python-testing-helper/compare/v1.1.0...HEAD
45
+ [ 1.1.0 ] : https://github.com/GoogleCloudPlatform/terraform-python-testing-helper/compare/v1.0.1...v1.1.0
39
46
[ 1.0.1 ] : https://github.com/GoogleCloudPlatform/terraform-python-testing-helper/compare/v1.0.0...v1.0.1
40
47
[ 1.0.0 ] : https://github.com/GoogleCloudPlatform/terraform-python-testing-helper/compare/v0.6.2...v1.0.0
Original file line number Diff line number Diff line change
1
+ # Copyright 2019 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ "Test the Terraform value dict wrapper class."
16
+
17
+ import pytest
18
+ import tftest
19
+
20
+
21
+ _RAW = {'a' : {'value' : 1 , 'sensitive' : True }, 'b' : {'value' : 2 }}
22
+
23
+
24
+ @pytest .fixture
25
+ def wrapper ():
26
+ return tftest .TerraformValueDict (_RAW )
27
+
28
+
29
+ def test_getitem (wrapper ):
30
+ assert wrapper ['a' ] == 1
31
+
32
+
33
+ def test_getitem_dict_attrs (wrapper ):
34
+ assert wrapper .keys () == _RAW .keys ()
Original file line number Diff line number Diff line change 33
33
import tempfile
34
34
import weakref
35
35
36
- __version__ = '1.0.1 '
36
+ __version__ = '1.1.0 '
37
37
38
38
_LOGGER = logging .getLogger ('tftest' )
39
39
@@ -116,6 +116,9 @@ def __init__(self, raw):
116
116
# only matters for outputs
117
117
self .sensitive = tuple (k for k , v in raw .items () if v .get ('sensitive' ))
118
118
119
+ def __getattr__ (self , name ):
120
+ return getattr (self ._raw , name )
121
+
119
122
def __getitem__ (self , name ):
120
123
return self ._raw [name ].get ('value' )
121
124
You can’t perform that action at this time.
0 commit comments