-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move move fixtures for valid rows for docs with translations to conftest
- Loading branch information
1 parent
ab3271c
commit d60aec2
Showing
4 changed files
with
80 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import pandas as pd | ||
import pytest | ||
|
||
from gcf_data_mapper.enums.document import ( | ||
RequiredDocumentColumns, | ||
RequiredFamilyDocumentColumns, | ||
TranslatedDocumentColumns, | ||
) | ||
|
||
|
||
@pytest.fixture | ||
def mock_valid_doc_row_with_one_translation(): | ||
return pd.Series( | ||
{ | ||
RequiredFamilyDocumentColumns.APPROVED_REF.value: "ref123", | ||
RequiredFamilyDocumentColumns.PROJECTS_ID.value: "proj123", | ||
RequiredDocumentColumns.ID.value: "doc123", | ||
RequiredDocumentColumns.TYPE.value: "type123", | ||
RequiredDocumentColumns.TITLE.value: "title123", | ||
TranslatedDocumentColumns.SOURCE_URL.value: "link123", | ||
TranslatedDocumentColumns.TRANSLATED_FILES.value: "http://example.com", | ||
TranslatedDocumentColumns.TRANSLATED_TITLES.value: "title123", | ||
} | ||
) | ||
|
||
|
||
@pytest.fixture | ||
def mock_valid_doc_row_with_many_translations(): | ||
return pd.Series( | ||
{ | ||
RequiredFamilyDocumentColumns.APPROVED_REF.value: "ref123", | ||
RequiredFamilyDocumentColumns.PROJECTS_ID.value: "proj123", | ||
RequiredDocumentColumns.ID.value: "doc123", | ||
RequiredDocumentColumns.TYPE.value: "type123", | ||
RequiredDocumentColumns.TITLE.value: "title123", | ||
TranslatedDocumentColumns.SOURCE_URL.value: "link123,link456,link789", | ||
TranslatedDocumentColumns.TRANSLATED_FILES.value: "http://example.com|http://example.org|http://example.co.uk", | ||
TranslatedDocumentColumns.TRANSLATED_TITLES.value: "title123|title456|title789", | ||
} | ||
) | ||
|
||
|
||
@pytest.fixture | ||
def mock_valid_doc_row_with_two_translations(): | ||
return pd.Series( | ||
{ | ||
RequiredFamilyDocumentColumns.APPROVED_REF.value: "ref123", | ||
RequiredFamilyDocumentColumns.PROJECTS_ID.value: "proj123", | ||
RequiredDocumentColumns.ID.value: "doc123", | ||
RequiredDocumentColumns.TYPE.value: "type123", | ||
RequiredDocumentColumns.TITLE.value: "title123", | ||
TranslatedDocumentColumns.SOURCE_URL.value: "link123,link456", | ||
TranslatedDocumentColumns.TRANSLATED_FILES.value: "http://example.com|http://example.org", | ||
TranslatedDocumentColumns.TRANSLATED_TITLES.value: "title123|title456", | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters