MCPcopy Create free account
hub / github.com/bleachbit/bleachbit / test_keep_list

Method test_keep_list

tests/TestOptions.py:136–152  ·  view source on GitHub ↗

Test for get_whitelist_paths() / set_whitelist_paths()

(self)

Source from the content-addressed store, hash-verified

134 self.assertFalse(o.get_tree("parent", "child"))
135
136 def test_keep_list(self):
137 """Test for get_whitelist_paths() / set_whitelist_paths()"""
138 o = bleachbit.Options.options
139 # FIXME: finish renaming whitelist to keep list
140 self.assertIsInstance(o.get_whitelist_paths(), list)
141 keep_list = [('file', '/home/foo'), ('folder', '/home'),
142 ('file', '/home/unicode/кодирование')]
143 old_keep_list = o.get_whitelist_paths()
144 o.config.remove_section('whitelist/paths')
145 self.assertIsInstance(o.get_whitelist_paths(), list)
146 self.assertEqual(o.get_whitelist_paths(), [])
147 o.set_whitelist_paths(keep_list)
148 self.assertIsInstance(o.get_whitelist_paths(), list)
149 self.assertEqual(set(keep_list), set(o.get_whitelist_paths()))
150 o.set_whitelist_paths(old_keep_list)
151 o.close()
152 self.assertEqual(set(old_keep_list), set(o.get_whitelist_paths()))
153
154 def test_init_configuration(self):
155 """Test for init_configuration()"""

Callers

nothing calls this directly

Calls 3

get_whitelist_pathsMethod · 0.80
set_whitelist_pathsMethod · 0.80
closeMethod · 0.80

Tested by

no test coverage detected