Skip to content

Commit

Permalink
Correct dtype in unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahshi committed Jan 25, 2024
1 parent 390ac77 commit 39b33d1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions UnitTests/test_cm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@


class test_InsertTotals(unittest.TestCase):

def test_insert_totals(self):
# Create a sample DataFrame
df = pd.DataFrame({'A': [1.0, 2.0], 'B': [3.0, 4.0]})
mm.insert_totals(df)

# Expected DataFrame after insert_totals
# Ensure the index is of the same type as df's index
expected_df = pd.DataFrame({'A': [1.0, 2.0, 3.0], 'B': [3.0, 4.0, 7.0], 'sum_row': [4.0, 6.0, 10.0]},
index=[0, 1, 'sum_col'])

# Check if DataFrame is modified correctly
pd.testing.assert_frame_equal(df, expected_df)

def test_insert_totals(self):
# Create a sample DataFrame
df = pd.DataFrame({'A': [1, 2], 'B': [3, 4]})
Expand Down Expand Up @@ -45,6 +59,7 @@ def test_config_cell_text_and_colors(self, mock_text):
self.assertIsInstance(text_add, list, "text_add should be a list")
self.assertIsInstance(text_del, list, "text_del should be a list")


class test_ppMatrix(unittest.TestCase):

@patch('matplotlib.pyplot.figure')
Expand Down

0 comments on commit 39b33d1

Please sign in to comment.