Lines Matching refs:self

32     def setUp(self):
34 self._backup_config_vars = dict(sysconfig._config_vars)
36 def tearDown(self):
39 sysconfig._config_vars.update(self._backup_config_vars)
41 def test_home_installation_scheme(self):
45 builddir = self.mkdtemp()
60 self.assertEqual(cmd.install_base, destination)
61 self.assertEqual(cmd.install_platbase, destination)
66 self.assertEqual(got, expected)
79 def test_user_site(self):
82 self.old_user_base = site.USER_BASE
83 self.old_user_site = site.USER_SITE
84 self.tmpdir = self.mkdtemp()
85 self.user_base = os.path.join(self.tmpdir, 'B')
86 self.user_site = os.path.join(self.tmpdir, 'S')
87 site.USER_BASE = self.user_base
88 site.USER_SITE = self.user_site
89 install_module.USER_BASE = self.user_base
90 install_module.USER_SITE = self.user_site
93 return self.tmpdir
94 self.old_expand = os.path.expanduser
98 site.USER_BASE = self.old_user_base
99 site.USER_SITE = self.old_user_site
100 install_module.USER_BASE = self.old_user_base
101 install_module.USER_SITE = self.old_user_site
102 os.path.expanduser = self.old_expand
104 self.addCleanup(cleanup)
108 self.assertIn(key, INSTALL_SCHEMES)
116 self.assertIn('user', options)
122 self.assertFalse(os.path.exists(self.user_base))
123 self.assertFalse(os.path.exists(self.user_site))
129 self.assertTrue(os.path.exists(self.user_base))
130 self.assertTrue(os.path.exists(self.user_site))
132 self.assertIn('userbase', cmd.config_vars)
133 self.assertIn('usersite', cmd.config_vars)
135 def test_handle_extra_path(self):
141 self.assertEqual(cmd.extra_path, ['path', 'dirs'])
142 self.assertEqual(cmd.extra_dirs, 'dirs')
143 self.assertEqual(cmd.path_file, 'path')
148 self.assertEqual(cmd.extra_path, ['path'])
149 self.assertEqual(cmd.extra_dirs, 'path')
150 self.assertEqual(cmd.path_file, 'path')
155 self.assertEqual(cmd.extra_path, None)
156 self.assertEqual(cmd.extra_dirs, '')
157 self.assertEqual(cmd.path_file, None)
161 self.assertRaises(DistutilsOptionError, cmd.handle_extra_path)
163 def test_finalize_options(self):
171 self.assertRaises(DistutilsOptionError, cmd.finalize_options)
176 self.assertRaises(DistutilsOptionError, cmd.finalize_options)
182 self.assertRaises(DistutilsOptionError, cmd.finalize_options)
184 def test_record(self):
185 install_dir = self.mkdtemp()
186 project_dir, dist = self.create_dist(py_modules=['hello'],
189 self.write_file('hello.py', "def main(): print('o hai')")
190 self.write_file('sayhi', 'from hello import main; main()')
209 self.assertEqual(found, expected)
212 def test_record_extensions(self):
215 self.skipTest('The %r command is not found' % cmd)
216 install_dir = self.mkdtemp()
217 project_dir, dist = self.create_dist(ext_modules=[
243 self.assertEqual(found, expected)
245 def test_debug_mode(self):
247 old_logs_len = len(self.logs)
251 self.test_record()
254 self.assertGreater(len(self.logs), old_logs_len)