def test_appending_paths(self): new_path_list = self._setup_test_areas() try: num_of_dirs = len(config.getDataSearchDirs()) config.appendDataSearchDir(str(new_path_list[0])) updated_paths = config.getDataSearchDirs() finally: self._clean_up_test_areas() self.assertEqual(num_of_dirs + 1, len(updated_paths))
def do_test(paths): config.setDataSearchDirs(paths) newpaths = config.getDataSearchDirs() # Clean up here do that if the assert fails # it doesn't bring all the other tests down self._clean_up_test_areas() self.assertEqual(len(newpaths), 2) self.assertTrue('tmp' in newpaths[0]) self.assertTrue('tmp_2' in newpaths[1])
def test_appending_paths(self): new_path_list = self._setup_test_areas() try: config.appendDataSearchDir(six.text_type(new_path_list[0])) updated_paths = config.getDataSearchDirs() finally: self._clean_up_test_areas() self.assertEqual(4, len(updated_paths))
def test_setting_paths_via_single_string(self): new_path_list = self._setup_test_areas() path_str = ';'.join(new_path_list) config.setDataSearchDirs(path_str) paths = config.getDataSearchDirs() # Clean up here do that if the assert fails # it doesn't bring all the other tests down self._clean_up_test_areas() self.assertTrue(len(paths), 2) self.assertTrue('tmp' in paths[0]) self.assertTrue('tmp_2' in paths[1]) self._clean_up_test_areas()
def test_getting_search_paths(self): """Retrieve the search paths """ paths = config.getDataSearchDirs() self.assertEquals(type(paths), std_vector_str) self.assert_(len(paths) > 0)