コード例 #1
0
ファイル: test_installer.py プロジェクト: pombreda/dukpy
    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'))
コード例 #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'))
コード例 #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'))
コード例 #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
コード例 #5
0
 def test_install_command_missing_args(self):
     with mock.patch.object(sys, 'argv', ['dukpy-install']):
         dukpy_install.main()
コード例 #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'))
コード例 #7
0
 def test_install_command_missing_args(self):
     with self.assertRaises(SystemExit):
         with mock.patch.object(sys, 'argv', ['dukpy-install']):
             dukpy_install.main()
コード例 #8
0
ファイル: test_installer.py プロジェクト: pombreda/dukpy
 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
コード例 #9
0
ファイル: test_installer.py プロジェクト: pombreda/dukpy
 def test_install_command_missing_args(self):
     with mock.patch.object(sys, 'argv', ['dukpy-install']):
         dukpy_install.main()
コード例 #10
0
ファイル: test_installer.py プロジェクト: pombreda/dukpy
 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'))