def test_install_command_without_dest(self): if os.path.exists('./js_modules'): raise SkipTest('local destination directory already exists...') with mock.patch.object(sys, 'argv', ['dukpy-install', 'react', '0.14.8']): dukpy_install.main() assert os.path.exists(os.path.join('./js_modules', 'react'))
def test_install_scoped_package(self): with mock.patch.object( sys, 'argv', ['dukpy-install', '@reactivex/rxjs', '5.0.0-beta.11']): dukpy_install.main() assert os.path.exists( os.path.join('./js_modules', '@reactivex', 'rxjs'))
def test_install_command_substrate_error(self): with mock.patch.object( sys, 'argv', ['dukpy-install', 'react', '9999', '-d', self.tmpdir]): assert dukpy_install.main() == 2
def test_install_command_missing_args(self): with mock.patch.object(sys, 'argv', ['dukpy-install']): dukpy_install.main()
def test_install_command_latest_ver(self): with mock.patch.object(sys, 'argv', ['dukpy-install', 'react', '-d', self.tmpdir]): dukpy_install.main() assert os.path.exists(os.path.join(self.tmpdir, 'react'))
def test_install_command_missing_args(self): with self.assertRaises(SystemExit): with mock.patch.object(sys, 'argv', ['dukpy-install']): dukpy_install.main()
def test_install_command_substrate_error(self): with mock.patch.object(sys, 'argv', ['dukpy-install', 'react', '9999', '-d', self.tmpdir]): assert dukpy_install.main() == 2