当前位置: 首页>>代码示例>>Python>>正文


Python Folder.navigate_to方法代码示例

本文整理汇总了Python中core.osutils.folder.Folder.navigate_to方法的典型用法代码示例。如果您正苦于以下问题:Python Folder.navigate_to方法的具体用法?Python Folder.navigate_to怎么用?Python Folder.navigate_to使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在core.osutils.folder.Folder的用法示例。


在下文中一共展示了Folder.navigate_to方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_370_tns_run_android_with_jar_and_aar_files_in_app_res

# 需要导入模块: from core.osutils.folder import Folder [as 别名]
# 或者: from core.osutils.folder.Folder import navigate_to [as 别名]
    def test_370_tns_run_android_with_jar_and_aar_files_in_app_res(self):
        """
        App should not crash when reference .jar or/and .aar file in App_Resources/Android/libs
        https://github.com/NativeScript/android-runtime/issues/899
        """

        # Create libs/ in app/App_resources/, add .jar and .aar files in it and modify the app to reference them
        curr_folder = os.getcwd()
        Folder.navigate_to(os.path.join(self.app_name, 'app', 'App_Resources', 'Android'))
        Folder.create("libs")
        app_res_libs = os.path.join(self.app_name, 'app', 'App_Resources', 'Android', 'libs')
        Folder.navigate_to(curr_folder)

        custom_jar_file = os.path.join('data', 'issues', 'android-runtime-pr-905', 'customLib.jar')
        custom_aar_file = os.path.join('data', 'issues', 'android-runtime-899', 'mylibrary.aar')

        File.copy(src=custom_jar_file, dest=app_res_libs)
        File.copy(src=custom_aar_file, dest=app_res_libs)

        source = os.path.join('data', 'issues', 'android-runtime-899', 'app.js')
        target = os.path.join(self.app_name, 'app', 'app.js')
        File.copy(src=source, dest=target)

        # `tns run android` and wait until app is deployed
        log = Tns.run_android(attributes={'--path': self.app_name, '--device': EMULATOR_ID}, wait=False,
                              assert_success=False)
        strings = ['Project successfully built',
                   'Successfully installed on device with identifier', EMULATOR_ID,
                   'Successfully synced application']
        Tns.wait_for_log(log_file=log, string_list=strings, timeout=180, check_interval=10)

        # Verify app looks correct inside emulator
        Device.screen_match(device_name=EMULATOR_NAME, device_id=EMULATOR_ID,
                            expected_image='livesync-hello-world_home')
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:36,代码来源:run_android_tests.py

示例2: __run_yarn_command

# 需要导入模块: from core.osutils.folder import Folder [as 别名]
# 或者: from core.osutils.folder.Folder import navigate_to [as 别名]
 def __run_yarn_command(command, folder=None, log_level=CommandLogLevel.FULL):
     if folder is not None:
         Folder.navigate_to(folder=folder, relative_from_current_folder=True)
     output = run('yarn {0}'.format(command), log_level=log_level)
     if folder is not None:
         Folder.navigate_to(TEST_RUN_HOME, relative_from_current_folder=False)
     return output
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:9,代码来源:npm.py

示例3: test_200_build_android_inside_project_folder

# 需要导入模块: from core.osutils.folder import Folder [as 别名]
# 或者: from core.osutils.folder.Folder import navigate_to [as 别名]
 def test_200_build_android_inside_project_folder(self):
     Folder.navigate_to(self.app_name)
     output = Tns.build_android(tns_path=os.path.join("..", TNS_PATH), attributes={"--path": self.app_name},
                                assert_success=False, log_trace=True)
     Folder.navigate_to(TEST_RUN_HOME, relative_from_current_folder=False)
     assert successfully_prepared in output
     assert build_successful in output
     assert successfully_built in output
     assert File.exists(os.path.join(self.app_name, TnsAsserts.PLATFORM_ANDROID_APK_DEBUG_PATH, self.debug_apk))
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:11,代码来源:build_android_tests.py

示例4: pack

# 需要导入模块: from core.osutils.folder import Folder [as 别名]
# 或者: from core.osutils.folder.Folder import navigate_to [as 别名]
 def pack(folder, output_file):
     try:
         Folder.navigate_to(folder)
         run('npm pack', log_level=CommandLogLevel.SILENT)
         src_file = File.find_by_extension('tgz')[0]
         File.copy(src=src_file, dest=output_file)
         File.remove(src_file)
     except:
         print 'Failed to pack {0}'.format(folder)
     Folder.navigate_to(TEST_RUN_HOME, relative_from_current_folder=False)
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:12,代码来源:npm.py

示例5: test_210_platform_not_need_remove_after_bitcode_error

# 需要导入模块: from core.osutils.folder import Folder [as 别名]
# 或者: from core.osutils.folder.Folder import navigate_to [as 别名]
 def test_210_platform_not_need_remove_after_bitcode_error(self):
     # https://github.com/NativeScript/nativescript-cli/issues/3741
     Tns.platform_remove(platform=Platform.ANDROID, attributes={"--path": self.app_name}, assert_success=False)
     Folder.navigate_to(self.app_name + "/app")
     path = os.path.join(self.app_name + "/app")
     run("touch a")
     run("ln -s a b")
     run("rm a")
     Folder.navigate_to(folder=TEST_RUN_HOME, relative_from_current_folder=False)
     output = Tns.prepare_android(attributes={"--path": self.app_name})
     assert "Project successfully prepared" in output
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:13,代码来源:prepare_android_tests.py

示例6: install_npm

# 需要导入模块: from core.osutils.folder import Folder [as 别名]
# 或者: from core.osutils.folder.Folder import navigate_to [as 别名]
    def install_npm(package='', option='', folder=None, log_level=CommandLogLevel.FULL):
        cmd = UPDATE_WEBPACK_PATH + " --configs --deps"
        Npm.install(package=package, option=option, folder=folder, log_level=log_level)
        if folder is not None:
            Folder.navigate_to(folder=folder, relative_from_current_folder=True)

        print cmd
        output = run(command=cmd)

        if folder is not None:
            Folder.navigate_to(TEST_RUN_HOME, relative_from_current_folder=False)

        return output
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:15,代码来源:tns.py

示例7: test_320_prepare_scoped_plugins

# 需要导入模块: from core.osutils.folder import Folder [as 别名]
# 或者: from core.osutils.folder.Folder import navigate_to [as 别名]
    def test_320_prepare_scoped_plugins(self):
        """
        Test for https://github.com/NativeScript/nativescript-cli/pull/3080

        Before this change we copied all NG components at following location (js demo of nativescript-facebook):
        platforms/android/src/main/assets/app/tns_modules/nativescript-facebook/node_modules/@angular

        Now folder above should be empty (or not existing at all).
        """

        Folder.cleanup("nativescript-facebook")
        Git.clone_repo(repo_url='[email protected]:NativeScript/nativescript-facebook.git',
                       local_folder="nativescript-facebook")
        Folder.navigate_to(folder="nativescript-facebook/src")
        output = run(command="npm run build")
        Folder.navigate_to(folder=TEST_RUN_HOME, relative_from_current_folder=False)
        assert "tsc" in output
        assert "ERR" not in output
        Tns.prepare_android(attributes={"--path": "nativescript-facebook/demo"})
        output = run(command="find nativescript-facebook/demo/platforms/android/ | grep @")
        assert "@angular/core" not in output, "@angular/* should not be in platforms folder."
        assert "@angular/router" not in output, "@angular/* should not be in platforms folder."
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:24,代码来源:prepare_android_tests.py

示例8: setUp

# 需要导入模块: from core.osutils.folder import Folder [as 别名]
# 或者: from core.osutils.folder.Folder import navigate_to [as 别名]
 def setUp(self):
     BaseClass.setUp(self)
     # Ensure app is in initial state
     Folder.navigate_to(folder=TEST_RUN_HOME, relative_from_current_folder=False)
     Folder.cleanup(self.app_name)
     Folder.copy(TEST_RUN_HOME + "/data/TestApp", TEST_RUN_HOME + "/TestApp")
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:8,代码来源:android_app_bundle_tests.py

示例9: test_120_platform_add_android_inside_project

# 需要导入模块: from core.osutils.folder import Folder [as 别名]
# 或者: from core.osutils.folder.Folder import navigate_to [as 别名]
 def test_120_platform_add_android_inside_project(self):
     """ Add platform inside project folder (not using --path)"""
     Folder.navigate_to(self.app_name)
     output = Tns.platform_add_android(tns_path=os.path.join("..", TNS_PATH), assert_success=False)
     Folder.navigate_to(TEST_RUN_HOME, relative_from_current_folder=False)
     TnsAsserts.platform_added(self.app_name, platform=Platform.ANDROID, output=output)
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:8,代码来源:platform_android_tests.py

示例10: test_102_prepare_android_inside_project

# 需要导入模块: from core.osutils.folder import Folder [as 别名]
# 或者: from core.osutils.folder.Folder import navigate_to [as 别名]
 def test_102_prepare_android_inside_project(self):
     Folder.navigate_to(self.app_name)
     output = Tns.prepare_android(tns_path=os.path.join("..", TNS_PATH), assert_success=False)
     Folder.navigate_to(TEST_RUN_HOME, relative_from_current_folder=False)
     TnsAsserts.prepared(self.app_name, platform=Platform.ANDROID, output=output, prepare=Prepare.FULL)
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:7,代码来源:prepare_android_tests.py


注:本文中的core.osutils.folder.Folder.navigate_to方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。