Anonymous avatar Anonymous committed debb51a

builtintest: moved BuiltinModulesTest

Comments (0)

Files changed (3)

ropetest/__init__.py

     result.addTests(ropetest.objectdbtest.suite())
     result.addTests(ropetest.advanced_oi_test.suite())
     result.addTests(ropetest.runmodtest.suite())
-    result.addTests(unittest.makeSuite(ropetest.builtinstest.BuiltinTypesTest))
+    result.addTests(ropetest.builtinstest.suite())
     result.addTests(ropetest.historytest.suite())
     return result
 

ropetest/builtinstest.py

                           pymod['l'].get_object().get_type())
 
 
+class BuiltinModulesTest(unittest.TestCase):
+
+    def setUp(self):
+        super(BuiltinModulesTest, self).setUp()
+        self.project = testutils.sample_project(
+            extension_modules=['time', 'invalid_module'])
+        self.pycore = self.project.get_pycore()
+        self.mod = testutils.create_module(self.project, 'mod')
+
+    def tearDown(self):
+        testutils.remove_project(self.project)
+        super(BuiltinModulesTest, self).tearDown()
+
+    def test_simple_case(self):
+        self.mod.write('import time')
+        pymod = self.pycore.resource_to_pyobject(self.mod)
+        self.assertTrue('time' in pymod['time'].get_object())
+
+    def test_ignored_extensions(self):
+        self.mod.write('import os')
+        pymod = self.pycore.resource_to_pyobject(self.mod)
+        self.assertTrue('rename' not in pymod['os'].get_object())
+
+    def test_ignored_extensions(self):
+        self.mod.write('import os')
+        pymod = self.pycore.resource_to_pyobject(self.mod)
+        self.assertTrue('rename' not in pymod['os'].get_object())
+
+    def test_nonexistent_modules(self):
+        self.mod.write('import invalid_module')
+        pymod = self.pycore.resource_to_pyobject(self.mod)
+        pymod['invalid_module'].get_object()
+
+
+def suite():
+    result = unittest.TestSuite()
+    result.addTests(unittest.makeSuite(BuiltinTypesTest))
+    result.addTests(unittest.makeSuite(BuiltinModulesTest))
+    return result
+
+
 if __name__ == '__main__':
     unittest.main()

ropetest/pycoretest.py

         self.assertTrue(self.project.pycore.is_python_file(myscript))
 
 
-class BuiltinModulesTest(unittest.TestCase):
-
-    def setUp(self):
-        super(BuiltinModulesTest, self).setUp()
-        self.project = testutils.sample_project(
-            extension_modules=['time', 'invalid_module'])
-        self.pycore = self.project.get_pycore()
-        self.mod = testutils.create_module(self.project, 'mod')
-
-    def tearDown(self):
-        testutils.remove_project(self.project)
-        super(BuiltinModulesTest, self).tearDown()
-
-    def test_simple_case(self):
-        self.mod.write('import time')
-        pymod = self.pycore.resource_to_pyobject(self.mod)
-        self.assertTrue('time' in pymod['time'].get_object())
-
-    def test_ignored_extensions(self):
-        self.mod.write('import os')
-        pymod = self.pycore.resource_to_pyobject(self.mod)
-        self.assertTrue('rename' not in pymod['os'].get_object())
-
-    def test_ignored_extensions(self):
-        self.mod.write('import os')
-        pymod = self.pycore.resource_to_pyobject(self.mod)
-        self.assertTrue('rename' not in pymod['os'].get_object())
-
-    def test_nonexistent_modules(self):
-        self.mod.write('import invalid_module')
-        pymod = self.pycore.resource_to_pyobject(self.mod)
-        pymod['invalid_module'].get_object()
-
-
 def suite():
     result = unittest.TestSuite()
     result.addTests(unittest.makeSuite(PyCoreTest))
     result.addTests(unittest.makeSuite(ClassHierarchyTest))
     result.addTests(unittest.makeSuite(TextChangeDetectorTest))
     result.addTests(unittest.makeSuite(PyCoreProjectConfigsTest))
-    result.addTests(unittest.makeSuite(BuiltinModulesTest))
     return result
 
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.