Skip to content

Commit

Permalink
Merge branch 'main' of github.com:alphanome-ai/sec-parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Elijas committed Dec 28, 2023
2 parents 8d06ed9 + 79565f5 commit 1f40110
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 19 deletions.
3 changes: 0 additions & 3 deletions tests/unit/processing_engine/test_html_tag.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from unittest import mock
from unittest.mock import Mock

import bs4
import pytest
from bs4 import NavigableString
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from unittest.mock import Mock

import bs4
import pytest

Expand Down
2 changes: 0 additions & 2 deletions tests/unit/processing_steps/test_empty_element_classifier.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from unittest.mock import Mock

import pytest

from sec_parser.processing_engine.core import Edgar10QParser
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from unittest.mock import Mock

import bs4
import pytest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from unittest.mock import Mock

import bs4

from sec_parser.processing_engine.html_tag import HtmlTag
Expand Down
16 changes: 8 additions & 8 deletions tests/unit/semantic_elements/table_element/test_table_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ def test_table_element_get_summary(test_case):
numbers = test_case["numbers"]
text = test_case["text"]
expected_summary = test_case["expected_summary"]
mock_semantic_element = Mock()
mock_semantic_element.text = text
mock_semantic_element.get_approx_table_metrics.return_value = ApproxTableMetrics(
mock_html_tag = Mock()
mock_html_tag.text = text
mock_html_tag.get_approx_table_metrics.return_value = ApproxTableMetrics(
rows,
numbers,
)
table_element = TableElement(mock_semantic_element)
table_element = TableElement(mock_html_tag)

# Act
result = table_element.get_summary()
Expand All @@ -55,15 +55,15 @@ def test_table_element_get_summary(test_case):

def test_to_dict():
# Arrange
mock_semantic_element = Mock(spec=HtmlTag)
mock_semantic_element.get_approx_table_metrics.return_value = ApproxTableMetrics(
mock_html_tag = Mock(spec=HtmlTag)
mock_html_tag.get_approx_table_metrics.return_value = ApproxTableMetrics(
5, 6
)
mock_semantic_element.to_dict.return_value = (
mock_html_tag.to_dict.return_value = (
{}
) # Mock the to_dict method to return an empty dictionary

table_element = TableElement(mock_semantic_element)
table_element = TableElement(mock_html_tag)

# Act
actual = table_element.to_dict(include_previews=True)
Expand Down

0 comments on commit 1f40110

Please sign in to comment.