def test_install_init_install_production(self):
stub_mod_call(self, cli)
stub_base_which(self, which_yarn)
tmpdir = mkdtemp(self)
os.chdir(tmpdir)
dist = Distribution(dict(
script_name='setup.py',
script_args=['yarn', '--init', '--install', '--production'],
name='foo',
))
dist.parse_command_line()
dist.run_commands()
with open(os.path.join(tmpdir, 'package.json')) as fd:
result = json.load(fd)
self.assertEqual(result, {
'dependencies': {'jquery': '~1.11.0'},
'devDependencies': {},
'name': 'foo',
})
# Should still invoke install
self.assertEqual(self.call_args[0], (
[which_yarn, 'install', '--production=true'],))
评论列表
文章目录