Skip to content

Commit 968143b

Browse files
crwilcoxJon Wayne Parrott
authored andcommitted
Release dlp 0.4.0 (googleapis#5160)
1 parent 02cc70d commit 968143b

File tree

3 files changed

+28
-8
lines changed

3 files changed

+28
-8
lines changed

dlp/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
[1]: https://pypi.org/project/google-cloud-dlp/#history
66

7+
## 0.4.0
8+
9+
### Implementation Changes
10+
11+
- Remove DLP client version V2Beta1 (#5155)
12+
713
## 0.3.0
814

915
### Implementation changes

dlp/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
name = 'google-cloud-dlp'
2424
description = 'Google Cloud DLP API client library'
25-
version = '0.3.0'
25+
version = '0.4.0'
2626
# Should be one of:
2727
# 'Development Status :: 3 - Alpha'
2828
# 'Development Status :: 4 - Beta'

dlp/tests/system/gapic/v2/test_system_dlp_service_v2.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,35 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import time
15+
import json
16+
import os
1617

1718
from google.cloud import dlp_v2
1819
from google.cloud.dlp_v2 import enums
1920
from google.cloud.dlp_v2.proto import dlp_pb2
2021

2122

2223
class TestSystemDlpService(object):
24+
25+
def _get_project_id(self):
26+
env_var_name = 'GOOGLE_APPLICATION_CREDENTIALS'
27+
path = os.environ[env_var_name]
28+
json_data=open(path).read()
29+
data = json.loads(json_data)
30+
return data['project_id']
31+
2332
def test_inspect_content(self):
33+
# get project id from json file
34+
project_id = self._get_project_id()
2435

2536
client = dlp_v2.DlpServiceClient()
2637
min_likelihood = enums.Likelihood.POSSIBLE
27-
inspect_config = {'min_likelihood': min_likelihood}
28-
type_ = 'text/plain'
29-
value = 'my phone number is 215-512-1212'
30-
items_element = {'type': type_, 'value': value}
31-
items = [items_element]
32-
response = client.inspect_content(inspect_config, items)
38+
info_types = [{'name': 'FIRST_NAME'}, {'name': 'LAST_NAME'}]
39+
inspect_config = {
40+
'info_types': info_types,
41+
'min_likelihood': min_likelihood,
42+
}
43+
item = {'value': 'Robert Frost'}
44+
parent = client.project_path(project_id)
45+
response = client.inspect_content(parent, inspect_config, item)
46+

0 commit comments

Comments
 (0)