Ejemplo n.º 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'))
Ejemplo n.º 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'))
Ejemplo n.º 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'))
Ejemplo n.º 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
Ejemplo n.º 5
0
 def test_install_command_missing_args(self):
     with mock.patch.object(sys, 'argv', ['dukpy-install']):
         dukpy_install.main()
Ejemplo n.º 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'))
Ejemplo n.º 7
0
 def test_install_command_missing_args(self):
     with self.assertRaises(SystemExit):
         with mock.patch.object(sys, 'argv', ['dukpy-install']):
             dukpy_install.main()
Ejemplo n.º 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
Ejemplo n.º 9
0
 def test_install_command_missing_args(self):
     with mock.patch.object(sys, 'argv', ['dukpy-install']):
         dukpy_install.main()
Ejemplo n.º 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'))