From 83a2b580f7b0071040e9baf6d2f6d8b3ddf3f458 Mon Sep 17 00:00:00 2001 From: Pablo Hoffman Date: Fri, 28 Aug 2009 17:58:50 -0300 Subject: [PATCH] renamed test_scrapy_ctl.py to test_commands.py --HG-- rename : scrapy/tests/test_scrapy_ctl.py => scrapy/tests/test_commands.py --- scrapy/tests/{test_scrapy_ctl.py => test_commands.py} | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) rename scrapy/tests/{test_scrapy_ctl.py => test_commands.py} (95%) diff --git a/scrapy/tests/test_scrapy_ctl.py b/scrapy/tests/test_commands.py similarity index 95% rename from scrapy/tests/test_scrapy_ctl.py rename to scrapy/tests/test_commands.py index db5360b42..b825623df 100644 --- a/scrapy/tests/test_scrapy_ctl.py +++ b/scrapy/tests/test_commands.py @@ -19,16 +19,14 @@ class ProjectTest(unittest.TestCase): def call(self, new_args, **kwargs): out = os.tmpfile() + env = getattr(self, 'env', os.environ) args = [sys.executable, '-m', 'scrapy.command.cmdline'] args.extend(new_args) - - env = getattr(self, 'env', os.environ) - return subprocess.call(args, stdout=out, stderr=out, cwd=self.cwd, \ - env=env, **kwargs) + env=env, **kwargs) -class ScrapyCtlStartprojectTest(ProjectTest): +class StartprojectTest(ProjectTest): def test_startproject(self): proj_path = join(self.temp_path, self.project_name) @@ -66,7 +64,7 @@ class CommandTest(ProjectTest): self.env['SCRAPY_SETTINGS_MODULE'] = '%s.settings' % self.project_name -class ScrapyCtlCommandsTest(CommandTest): +class MiscCommandsTest(CommandTest): def test_crawl(self): ret = self.call(['crawl']) @@ -112,5 +110,6 @@ class CsvFeedGenspiderTest(BaseGenspiderTest): class XMLFeedGenspiderTest(BaseGenspiderTest): template = 'xmlfeed' + if __name__ == '__main__': unittest.main()