def test_populate_includes(self): """Testing include population """ # open any existing file self.tearDown() self.setUpView('test_wrong_triggers.cpp') # now test the things settings = Settings() self.assertTrue(settings.is_valid()) settings.include_file_folder = True settings.include_parent_folder = True settings.include_dirs = [ path.realpath("/$project_name/src"), path.realpath("/test/test") ] initial_dirs = list(settings.include_dirs) dirs = settings.populate_include_dirs(self.view) current_folder = path.dirname(self.view.file_name()) parent_folder = path.dirname(current_folder) self.assertLess(len(initial_dirs), len(dirs)) self.assertNotEqual(dirs[0], initial_dirs[0]) self.assertEqual(dirs[1], initial_dirs[1]) self.assertEqual(dirs[2], current_folder) self.assertEqual(dirs[3], parent_folder)
def test_populate_includes(self): """Testing include population """ settings = Settings() self.assertTrue(settings.is_valid()) settings.include_file_folder = True settings.include_parent_folder = True settings.include_dirs = [ path.realpath("/$project_name/src"), path.realpath("/test/test") ] initial_dirs = list(settings.include_dirs) dirs = settings.populate_include_dirs(path.realpath(__file__), path.abspath(path.curdir)) self.assertLess(len(initial_dirs), len(dirs)) self.assertNotEqual(dirs[0], initial_dirs[0]) self.assertEqual(dirs[1], initial_dirs[1]) self.assertEqual(dirs[2], path.realpath(__file__)) self.assertEqual(dirs[3], path.abspath(path.dirname(path.curdir)))