Beispiel #1
0
 def setUp(self):
     super(OutOfProjectTest, self).setUp()
     self.test_directory = 'temp_test_directory'
     testutils.remove_recursively(self.test_directory)
     os.mkdir(self.test_directory)
     self.project = testutils.sample_project()
     self.no_project = NoProject()
Beispiel #2
0
 def test_failure_when_project_root_exists_and_is_a_file(self):
     try:
         project_root = "sampleproject2"
         open(project_root, "w").close()
         project = Project(project_root)
     finally:
         testutils.remove_recursively(project_root)
Beispiel #3
0
 def setUp(self):
     super(OutOfProjectTest, self).setUp()
     self.test_directory = "temp_test_directory"
     testutils.remove_recursively(self.test_directory)
     os.mkdir(self.test_directory)
     self.project = testutils.sample_project()
     self.no_project = NoProject()
Beispiel #4
0
    def test_failure_when_project_root_exists_and_is_a_file(self):
        project_root = 'sampleproject2'
        open(project_root, 'w').close()
        with self.assertRaises(RopeError):
            Project(project_root)

        testutils.remove_recursively(project_root)
Beispiel #5
0
    def test_failure_when_project_root_exists_and_is_a_file(self):
        project_root = 'sampleproject2'
        open(project_root, 'w').close()
        with self.assertRaises(RopeError):
            Project(project_root)

        testutils.remove_recursively(project_root)
 def test_failure_when_project_root_exists_and_is_a_file(self):
     try:
         project_root = 'sampleproject2'
         open(project_root, 'w').close()
         project = Project(project_root)
     finally:
         testutils.remove_recursively(project_root)
Beispiel #7
0
 def test_failure_when_project_root_exists_and_is_a_file(self):
     project_root = "sampleproject2"
     try:
         open(project_root, "w").close()
         with self.assertRaises(RopeError):
             Project(project_root)
     finally:
         testutils.remove_recursively(project_root)
Beispiel #8
0
 def test_revalidating_folders(self):
     root = self.project.root
     my_folder = root.create_folder("myfolder")
     my_file = my_folder.create_file("myfile.txt")
     sample_observer = _SampleObserver()
     self.project.add_observer(FilteredResourceObserver(sample_observer, [my_folder]))
     testutils.remove_recursively(my_folder.real_path)
     self.project.validate(root)
     self.assertEquals(my_folder, sample_observer.last_removed)
     self.assertEquals(1, sample_observer.change_count)
Beispiel #9
0
 def test_revalidating_folders(self):
     root = self.project.root
     my_folder = root.create_folder('myfolder')
     my_file = my_folder.create_file('myfile.txt')  # noqa
     sample_observer = _SampleObserver()
     self.project.add_observer(
         FilteredResourceObserver(sample_observer, [my_folder]))
     testutils.remove_recursively(my_folder.real_path)
     self.project.validate(root)
     self.assertEquals(my_folder, sample_observer.last_removed)
     self.assertEquals(1, sample_observer.change_count)
Beispiel #10
0
 def setUp(self):
     unittest.TestCase.setUp(self)
     self.project_root = 'sample_project'
     testutils.remove_recursively(self.project_root)
     self._make_sample_project()
     self.sample_file2 = 'samplefile2.txt'
     self.core = Core.get_core()
     self.core._init_x()
     self.core._init_menus()
     self.core.prefs.set('project_rope_folder', None)
     self.core.open_project(self.project_root)
     self.textEditor = self.core.open_file(self.sample_file)
     self.project = self.core.get_open_project()
Beispiel #11
0
 def tearDown(self):
     testutils.remove_project(self.project)
     testutils.remove_recursively(self.test_directory)
     super(OutOfProjectTest, self).tearDown()
Beispiel #12
0
 def tearDown(self):
     testutils.remove_project(self.project)
     testutils.remove_recursively(self.test_directory)
     super(OutOfProjectTest, self).tearDown()
Beispiel #13
0
 def tearDown(self):
     self.core.close_project()
     testutils.remove_recursively(self.project_root)
     unittest.TestCase.tearDown(self)