Skip to content

Commit

Permalink
alternative skipif conditions in azure ocr converter test (#5906)
Browse files Browse the repository at this point in the history
  • Loading branch information
anakin87 authored Sep 28, 2023
1 parent 35ec8cc commit 9340c57
Showing 1 changed file with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,8 @@ def test_run(self, preview_samples_path):
}

@pytest.mark.integration
@pytest.mark.skipif(
"CORE_AZURE_CS_ENDPOINT" not in os.environ and "CORE_AZURE_CS_API_KEY" not in os.environ,
reason="Azure credentials not available",
)
@pytest.mark.skipif(not os.environ.get("CORE_AZURE_CS_ENDPOINT", None), reason="Azure credentials not available")
@pytest.mark.skipif(not os.environ.get("CORE_AZURE_CS_API_KEY", None), reason="Azure credentials not available")
def test_run_with_pdf_file(self, preview_samples_path):
component = AzureOCRDocumentConverter(
endpoint=os.environ["CORE_AZURE_CS_ENDPOINT"], api_key=os.environ["CORE_AZURE_CS_API_KEY"]
Expand All @@ -79,10 +77,8 @@ def test_run_with_pdf_file(self, preview_samples_path):
assert "Page 4 of Sample PDF" in documents[0].text

@pytest.mark.integration
@pytest.mark.skipif(
"CORE_AZURE_CS_ENDPOINT" not in os.environ and "CORE_AZURE_CS_API_KEY" not in os.environ,
reason="Azure credentials not available",
)
@pytest.mark.skipif(not os.environ.get("CORE_AZURE_CS_ENDPOINT", None), reason="Azure credentials not available")
@pytest.mark.skipif(not os.environ.get("CORE_AZURE_CS_API_KEY", None), reason="Azure credentials not available")
def test_with_image_file(self, preview_samples_path):
component = AzureOCRDocumentConverter(
endpoint=os.environ["CORE_AZURE_CS_ENDPOINT"], api_key=os.environ["CORE_AZURE_CS_API_KEY"]
Expand All @@ -94,10 +90,8 @@ def test_with_image_file(self, preview_samples_path):
assert "by deepset" in documents[0].text

@pytest.mark.integration
@pytest.mark.skipif(
"CORE_AZURE_CS_ENDPOINT" not in os.environ and "CORE_AZURE_CS_API_KEY" not in os.environ,
reason="Azure credentials not available",
)
@pytest.mark.skipif(not os.environ.get("CORE_AZURE_CS_ENDPOINT", None), reason="Azure credentials not available")
@pytest.mark.skipif(not os.environ.get("CORE_AZURE_CS_API_KEY", None), reason="Azure credentials not available")
def test_run_with_docx_file(self, preview_samples_path):
component = AzureOCRDocumentConverter(
endpoint=os.environ["CORE_AZURE_CS_ENDPOINT"], api_key=os.environ["CORE_AZURE_CS_API_KEY"]
Expand Down

0 comments on commit 9340c57

Please sign in to comment.