Skip to content

Commit

Permalink
Fixing unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
amontanez24 committed Jul 31, 2024
1 parent 60e830a commit 4fa7f6e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/unit/single_table/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test__check_metadata_updated(self):
@patch('sdv.single_table.base.generate_synthesizer_id')
@patch('sdv.single_table.base.DataProcessor')
@patch('sdv.single_table.base.BaseSingleTableSynthesizer._check_metadata_updated')
def test___init__(
def test___init___l(
self,
mock_check_metadata_updated,
mock_data_processor,
Expand Down Expand Up @@ -253,19 +253,22 @@ def test_get_parameters(self, mock_data_processor):
}

@patch('sdv.single_table.base.DataProcessor')
def test_get_metadata(self, mock_data_processor):
@patch('sdv.single_table.base.Metadata.load_from_dict')
def test_get_metadata(self, mock_load_from_dict, _):
"""Test that it returns the ``metadata`` object."""
# Setup
metadata = Mock(spec=Metadata)
instance = BaseSingleTableSynthesizer(
metadata, enforce_min_max_values=False, enforce_rounding=False
)
mock_converted_metadata = Mock()
mock_load_from_dict.return_value = mock_converted_metadata

# Run
result = instance.get_metadata()

# Assert
assert result == metadata
assert result == mock_converted_metadata

def test_auto_assign_transformers(self):
"""Test that the ``DataProcessor.prepare_for_fitting`` is being called."""
Expand Down

0 comments on commit 4fa7f6e

Please sign in to comment.