Skip to content

Commit bd0cf8b

Browse files
SK-2353: fix utils unit tests
1 parent 69fe686 commit bd0cf8b

File tree

2 files changed

+23
-18
lines changed

2 files changed

+23
-18
lines changed

.github/workflows/shared-build-and-deploy.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ jobs:
2727
python -m pip install --upgrade pip
2828
pip install setuptools wheel twine
2929
30+
- name: Build and install skyflow package
31+
run: |
32+
python setup.py sdist bdist_wheel
33+
pip install dist/skyflow-*.whl
34+
3035
- name: Resolve Branch for the Tagged Commit
3136
id: resolve-branch
3237
if: ${{ inputs.tag == 'beta' || inputs.tag == 'public' }}

tests/utils/test__utils.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -494,12 +494,12 @@ def test_parse_deidentify_text_response(self):
494494
mock_entity.value = "sensitive_value"
495495
mock_entity.entity_type = "EMAIL"
496496
mock_entity.entity_scores = {"EMAIL": 0.95}
497-
mock_entity.location = Mock(
498-
start_index=10,
499-
end_index=20,
500-
start_index_processed=15,
501-
end_index_processed=25
502-
)
497+
mock_entity.location = {
498+
"start_index": 10,
499+
"end_index": 20,
500+
"start_index_processed": 15,
501+
"end_index_processed":25
502+
}
503503

504504
mock_api_response = Mock()
505505
mock_api_response.processed_text = "Sample processed text"
@@ -555,12 +555,12 @@ def test__convert_detected_entity_to_entity_info(self):
555555
mock_detected_entity.value = "sensitive_value"
556556
mock_detected_entity.entity_type = "EMAIL"
557557
mock_detected_entity.entity_scores = {"EMAIL": 0.95}
558-
mock_detected_entity.location = Mock(
559-
start_index=10,
560-
end_index=20,
561-
start_index_processed=15,
562-
end_index_processed=25
563-
)
558+
mock_detected_entity.location = {
559+
"start_index": 10,
560+
"end_index": 20,
561+
"start_index_processed": 15,
562+
"end_index_processed":25
563+
}
564564

565565
result = convert_detected_entity_to_entity_info(mock_detected_entity)
566566

@@ -580,12 +580,12 @@ def test__convert_detected_entity_to_entity_info_with_minimal_data(self):
580580
mock_detected_entity.value = None
581581
mock_detected_entity.entity_type = "UNKNOWN"
582582
mock_detected_entity.entity_scores = {}
583-
mock_detected_entity.location = Mock(
584-
start_index=0,
585-
end_index=0,
586-
start_index_processed=0,
587-
end_index_processed=0
588-
)
583+
mock_detected_entity.location = {
584+
"start_index": 0,
585+
"end_index": 0,
586+
"start_index_processed":0,
587+
"end_index_processed":0
588+
}
589589

590590
result = convert_detected_entity_to_entity_info(mock_detected_entity)
591591

0 commit comments

Comments
 (0)