Exemple #1
0
    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'))
Exemple #2
0
 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'))
Exemple #3
0
    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'))
Exemple #4
0
 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
Exemple #5
0
 def test_install_command_missing_args(self):
     with mock.patch.object(sys, 'argv', ['dukpy-install']):
         dukpy_install.main()
Exemple #6
0
 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'))
Exemple #7
0
 def test_install_command_missing_args(self):
     with self.assertRaises(SystemExit):
         with mock.patch.object(sys, 'argv', ['dukpy-install']):
             dukpy_install.main()
Exemple #8
0
 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
Exemple #9
0
 def test_install_command_missing_args(self):
     with mock.patch.object(sys, 'argv', ['dukpy-install']):
         dukpy_install.main()
Exemple #10
0
 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'))