def test_view(self):
stub_mod_call(self, cli)
tmpdir = mkdtemp(self)
os.chdir(tmpdir)
dist = Distribution(dict(
script_name='setup.py',
script_args=['npm', '--view'],
name='foo',
))
dist.parse_command_line()
dist.run_commands()
self.assertFalse(exists(join(tmpdir, 'package.json')))
# also log handlers removed.
self.assertEqual(len(getLogger('calmjs.cli').handlers), 0)
# written to stdout with the correct indentation level.
self.assertIn('\n "jquery": "~1.11.0"', sys.stdout.getvalue())
评论列表
文章目录