Skip to content

Commit

Permalink
Release dlp 0.4.0 (#5160)
Browse files Browse the repository at this point in the history
  • Loading branch information
crwilcox authored and Jon Wayne Parrott committed Apr 6, 2018
1 parent 02cc70d commit 968143b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
6 changes: 6 additions & 0 deletions dlp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

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

## 0.4.0

### Implementation Changes

- Remove DLP client version V2Beta1 (#5155)

## 0.3.0

### Implementation changes
Expand Down
2 changes: 1 addition & 1 deletion dlp/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

name = 'google-cloud-dlp'
description = 'Google Cloud DLP API client library'
version = '0.3.0'
version = '0.4.0'
# Should be one of:
# 'Development Status :: 3 - Alpha'
# 'Development Status :: 4 - Beta'
Expand Down
28 changes: 21 additions & 7 deletions dlp/tests/system/gapic/v2/test_system_dlp_service_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,35 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import time
import json
import os

from google.cloud import dlp_v2
from google.cloud.dlp_v2 import enums
from google.cloud.dlp_v2.proto import dlp_pb2


class TestSystemDlpService(object):

def _get_project_id(self):
env_var_name = 'GOOGLE_APPLICATION_CREDENTIALS'
path = os.environ[env_var_name]
json_data=open(path).read()
data = json.loads(json_data)
return data['project_id']

def test_inspect_content(self):
# get project id from json file
project_id = self._get_project_id()

client = dlp_v2.DlpServiceClient()
min_likelihood = enums.Likelihood.POSSIBLE
inspect_config = {'min_likelihood': min_likelihood}
type_ = 'text/plain'
value = 'my phone number is 215-512-1212'
items_element = {'type': type_, 'value': value}
items = [items_element]
response = client.inspect_content(inspect_config, items)
info_types = [{'name': 'FIRST_NAME'}, {'name': 'LAST_NAME'}]
inspect_config = {
'info_types': info_types,
'min_likelihood': min_likelihood,
}
item = {'value': 'Robert Frost'}
parent = client.project_path(project_id)
response = client.inspect_content(parent, inspect_config, item)

0 comments on commit 968143b

Please sign in to comment.