def test_populate_flags(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_file_parent_folder = True settings.common_flags = [ "-I" + path.realpath("/$project_name/src"), "-I" + path.realpath("/test/test") ] initial_flags = list(settings.common_flags) dirs = settings.populate_common_flags(self.view) current_folder = path.dirname(self.view.file_name()) parent_folder = path.dirname(current_folder) self.assertLess(len(initial_flags), len(dirs)) self.assertFalse(initial_flags[0] in dirs) self.assertTrue(initial_flags[1] in dirs) self.assertTrue(("-I" + current_folder) in dirs) self.assertTrue(("-I" + parent_folder) in dirs)
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)))
def test_valid(self): """Test validity """ settings = Settings() self.assertTrue(settings.is_valid())