Skip to content

Commit

Permalink
Use assertIn instead of assertTrue
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhelle committed Oct 19, 2024
1 parent e1f6f90 commit a989d7f
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions tests/test_create_anonymous_dataframe_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ def test_can_create_anonymous_pandas_dataframes_from_class_with_constructor_argu
self,
):
df = Autodata.create_pandas_dataframe(SimpleClassB)
self.assertTrue("id" in df.columns)
self.assertTrue("name" in df.columns)
self.assertTrue("text" in df.columns)
self.assertIn("id", df.columns)
self.assertIn("name", df.columns)
self.assertIn("text", df.columns)

def test_can_create_anonymous_pandas_dataframes_from_class_with_constructor_class_arguments(
self,
):
df = Autodata.create_pandas_dataframe(SimpleClassC)
self.assertTrue("a" in df.columns)
self.assertTrue("b" in df.columns)
self.assertIn("a", df.columns)
self.assertIn("b", df.columns)


class CreateFakePandasDataFrameTests(unittest.TestCase):
Expand All @@ -69,16 +69,16 @@ def test_can_create_fake_pandas_dataframes_from_class_with_constructor_arguments
self,
):
df = Autodata.create_pandas_dataframe(SimpleClassB, use_fake_data=True)
self.assertTrue("id" in df.columns)
self.assertTrue("name" in df.columns)
self.assertTrue("text" in df.columns)
self.assertIn("id", df.columns)
self.assertIn("name", df.columns)
self.assertIn("text", df.columns)

def test_can_create_fake_pandas_dataframes_from_class_with_constructor_class_arguments(
self,
):
df = Autodata.create_pandas_dataframe(SimpleClassC, use_fake_data=True)
self.assertTrue("a" in df.columns)
self.assertTrue("b" in df.columns)
self.assertIn("a", df.columns)
self.assertIn("b", df.columns)


@dataclass
Expand Down Expand Up @@ -118,16 +118,16 @@ def test_can_create_anonymous_pandas_dataframes_from_class_with_constructor_clas
self,
):
df = Autodata.create_pandas_dataframe(HybridClassA)
self.assertTrue("b" in df.columns)
self.assertTrue("a" in df.columns)
self.assertIn("b", df.columns)
self.assertIn("a", df.columns)

def test_can_create_anonymous_pandas_dataframes_from_class_with_constructor_hybrid_class_arguments(
self,
):
df = Autodata.create_pandas_dataframe(HybridClassB)
self.assertTrue("c" in df.columns)
self.assertTrue("b" in df.columns)
self.assertTrue("a" in df.columns)
self.assertIn("c", df.columns)
self.assertIn("b", df.columns)
self.assertIn("a", df.columns)


class CreateFakePandasDataFrameFromDataClassTests(unittest.TestCase):
Expand All @@ -147,13 +147,13 @@ def test_can_create_fake_pandas_dataframes_from_class_with_constructor_class_arg
self,
):
df = Autodata.create_pandas_dataframe(HybridClassA, use_fake_data=True)
self.assertTrue("b" in df.columns)
self.assertTrue("a" in df.columns)
self.assertIn("b", df.columns)
self.assertIn("a", df.columns)

def test_can_create_anonymous_pandas_dataframes_from_class_with_constructor_hybrid_class_arguments(
self,
):
df = Autodata.create_pandas_dataframe(HybridClassB, use_fake_data=True)
self.assertTrue("c" in df.columns)
self.assertTrue("b" in df.columns)
self.assertTrue("a" in df.columns)
self.assertIn("c", df.columns)
self.assertIn("b", df.columns)
self.assertIn("a", df.columns)

0 comments on commit a989d7f

Please sign in to comment.