diff --git a/dlp/CHANGELOG.md b/dlp/CHANGELOG.md index c414c6fa9f2b..7f990e2b1de4 100644 --- a/dlp/CHANGELOG.md +++ b/dlp/CHANGELOG.md @@ -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 diff --git a/dlp/setup.py b/dlp/setup.py index 0a83fe717afc..a9743723f53b 100644 --- a/dlp/setup.py +++ b/dlp/setup.py @@ -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' diff --git a/dlp/tests/system/gapic/v2/test_system_dlp_service_v2.py b/dlp/tests/system/gapic/v2/test_system_dlp_service_v2.py index 344cfaacabee..ffc78e5dc4cb 100644 --- a/dlp/tests/system/gapic/v2/test_system_dlp_service_v2.py +++ b/dlp/tests/system/gapic/v2/test_system_dlp_service_v2.py @@ -12,7 +12,8 @@ # 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 @@ -20,13 +21,26 @@ 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) \ No newline at end of file + 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) +