Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions spectrafit/plugins/test/test_notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,3 +516,16 @@ def test_conv_2(
)

mock_show.assert_called_once()

def test_display_current_df(
self,
class_spectrafit_fit: SpectraFitNotebook,
dataframe_2: pd.DataFrame,
) -> None:
"""Test the display_current_df function."""
sp = class_spectrafit_fit
sp.df_pre = sp.df_org = sp.df_fit = dataframe_2
sp.display_current_df()
sp.display_original_df()
sp.display_preprocessed_df()
sp.display_fit_df()
7 changes: 7 additions & 0 deletions spectrafit/utilities/test/test_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import pytest

from spectrafit.utilities.transformer import list2dict
from spectrafit.utilities.transformer import remove_none_type


@pytest.fixture
Expand Down Expand Up @@ -75,3 +76,9 @@ def test_converter(
reference_dict (Dict[str, Dict[str, Any]]): Reference dictionary of two peaks.
"""
assert list2dict(reference_list) == reference_dict


def test_remove_none_type() -> None:
"""Test remove_none_type function."""
d = {"a": None, "b": {"c": None, "d": {"e": None, "f": 1}}}
assert remove_none_type(d) == {"b": {"d": {"f": 1}}}