Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: updated testing constraints #34

Merged
merged 24 commits into from
Jan 30, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
removed test issue
  • Loading branch information
galz10 committed Jan 30, 2023
commit fa5e0b356c217a3913d20119af1de59c8a3795a0
33 changes: 0 additions & 33 deletions tests/unit/test_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,39 +124,6 @@ def test_document_from_gcs_with_multiple_shards(get_bytes_multiple_files_mock):
assert len(actual.pages) == 48


@mock.patch("google.cloud.documentai_toolbox.wrappers.document.storage")
def test_get_bytes(mock_storage):

client = mock_storage.Client.return_value

mock_bucket = mock.Mock()
mock_bucket.blob.return_value.download_as_string.return_value = "test".encode(
"utf-8"
)

client.Bucket.return_value = mock_bucket

blobs = [
storage.Blob(
name="gs://test-directory/documentai/output/123456789/1/test_shard1.json",
bucket=mock_bucket,
),
storage.Blob(
name="gs://test-directory/documentai/output/123456789/1/test_shard2.json",
bucket=mock_bucket,
),
]

client.list_blobs.return_value = blobs

actual = document._get_bytes(
"gs://test-directory/documentai/", "output/123456789/1"
)
mock_storage.Client.assert_called_once()

assert actual == [b"", b""]


@mock.patch("google.cloud.documentai_toolbox.wrappers.document.storage")
def test_print_gcs_document_tree_with_one_folder(mock_storage, capfd):

Expand Down