def test_add_whitespace(self):
        """test that adding lines with whitespaces at the beginning depends on the settings"""
        # test ignoring lines starting with whitespaces
        self.history.hide_whitespace = True
        self.history.add("a")
        self.history.add(" b")
        self.history.add("c")
        # only 2 should have been added
        l = self.history.getlist()
        self.assertEqual(len(l), 2)
        self.assertNotIn("b", l)
        self.assertNotIn(" b", l)
        self.assertIn("a", l)
        self.assertIn("c", l)

        # clean
        self.history.clear()

        # test ignoring lines starting with whitespaces
        self.history.hide_whitespace = False
        self.history.add("a")
        self.history.add(" b")
        self.history.add("c")
        # all 3 should have been added
        l = self.history.getlist()
        self.assertEqual(len(l), 3)
        self.assertIn("b", l)
        self.assertNotIn(" b", l)  # whitespace should be stripped
        self.assertIn("a", l)
        self.assertIn("c", l)
test that adding lines with whitespaces at the beginning depends on the settings
tests/system/test_history.py