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


Python Tns.platform_add_ios方法代码示例

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


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

示例1: test_391_platform_list

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_ios [as 别名]
    def test_391_platform_list(self):
        """Platform list command should list installed platforms and if app is prepared for those platforms"""
        Folder.cleanup(self.app_name)
        Tns.create_app(self.app_name, update_modules=False)

        # `tns platform list` on brand new project
        output = Tns.platform_list(attributes={"--path": self.app_name})
        TnsAsserts.platform_list_status(output=output, prepared=Platform.NONE, added=Platform.NONE)

        # `tns platform list` when iOS is added
        Tns.platform_add_ios(attributes={"--path": self.app_name, "--frameworkPath": IOS_PACKAGE})
        output = Tns.platform_list(attributes={"--path": self.app_name})
        TnsAsserts.platform_list_status(output=output, prepared=Platform.NONE, added=Platform.IOS)

        # `tns platform list` when iOS is prepared
        Tns.prepare_ios(attributes={"--path": self.app_name})
        output = Tns.platform_list(attributes={"--path": self.app_name})
        TnsAsserts.platform_list_status(output=output, prepared=Platform.IOS, added=Platform.IOS)

        # `tns platform list` when android is added (iOS already prepared)
        Tns.platform_add_android(attributes={"--path": self.app_name, "--frameworkPath": ANDROID_PACKAGE})
        output = Tns.platform_list(attributes={"--path": self.app_name})
        TnsAsserts.platform_list_status(output=output, prepared=Platform.IOS, added=Platform.BOTH)

        # `tns platform list` when android is prepared (iOS already prepared)
        Tns.prepare_android(attributes={"--path": self.app_name})
        output = Tns.platform_list(attributes={"--path": self.app_name})
        TnsAsserts.platform_list_status(output=output, prepared=Platform.BOTH, added=Platform.BOTH)

        # Verify build both platforms is not allowed
        # Test for https://github.com/NativeScript/nativescript-cli/pull/3425
        output = Tns.run_tns_command(command="build", attributes={"--path": self.app_name})
        assert "The input is not valid sub-command for 'build' command" in output
        assert "<Platform> is the target mobile platform for which you want to build your project" in output
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:36,代码来源:platform_ios_tests.py

示例2: setUpClass

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_ios [as 别名]
    def setUpClass(cls):
        BaseClass.setUpClass(cls.__name__)
        Simulator.stop()
        cls.SIMULATOR_ID = Simulator.ensure_available(simulator_name=SIMULATOR_NAME)

        Tns.create_app(cls.app_name, update_modules=True)
        Tns.install_npm(package=WEBPACK_PACKAGE, option='--save-dev', folder=cls.app_name)
        Tns.platform_add_ios(attributes={'--path': cls.app_name, '--frameworkPath': IOS_PACKAGE})
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:10,代码来源:hello_world_js_hmr_ios.py

示例3: setUpClass

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_ios [as 别名]
 def setUpClass(cls):
     BaseClass.setUpClass(cls.__name__)
     if CURRENT_OS != OSType.OSX:
         raise NameError("Can not run iOS tests on non OSX OS.")
     else:
         Simulator.stop()
     Tns.create_app(cls.app_name)
     Tns.platform_add_ios(attributes={"--path": cls.app_name, "--frameworkPath": IOS_PACKAGE})
     Folder.copy(TEST_RUN_HOME + "/" + cls.app_name, TEST_RUN_HOME + "/data/TestApp")
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:11,代码来源:prepare_ios_tests.py

示例4: test_301_platform_update_ios

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_ios [as 别名]
    def test_301_platform_update_ios(self):
        Tns.platform_add_ios(version="2.2.0", attributes={"--path": self.app_name})
        output = File.read(self.app_name + os.sep + "package.json")
        assert "\"version\": \"2.2.0\"" in output

        Tns.platform_update("[email protected]", attributes={"--path": self.app_name, " <  data/keys/enter_key.txt": ""})
        output = File.read(self.app_name + os.sep + "package.json")
        assert "\"version\": \"2.3.0\"" in output

        Tns.build_ios(attributes={"--path": self.app_name})
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:12,代码来源:platform_ios_tests.py

示例5: setUpClass

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_ios [as 别名]
 def setUpClass(cls):
     BaseClass.setUpClass(cls.__name__)
     Emulator.stop()
     Simulator.stop()
     cls.SIMULATOR_ID = Simulator.ensure_available(simulator_name=SIMULATOR_NAME)
     Folder.cleanup(cls.app_name)
     Tns.create_app(cls.app_name,
                    attributes={'--template': os.path.join('data', 'apps', 'livesync-hello-world.tgz')},
                    update_modules=True)
     Tns.platform_add_ios(attributes={'--path': cls.app_name, '--frameworkPath': IOS_PACKAGE})
     Folder.cleanup(TEST_RUN_HOME + "/data/TestApp")
     Folder.copy(TEST_RUN_HOME + "/" + cls.app_name, TEST_RUN_HOME + "/data/TestApp")
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:14,代码来源:run_ios_tests.py

示例6: setUpClass

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_ios [as 别名]
    def setUpClass(cls):
        BaseClass.setUpClass(cls.__name__)
        Emulator.stop()
        Simulator.stop()
        Device.ensure_available(platform=Platform.IOS)
        Device.uninstall_app(app_prefix='org.nativescript.', platform=Platform.IOS)

        Folder.cleanup(cls.app_name)
        Tns.create_app(cls.app_name,
                       attributes={'--template': os.path.join('data', 'apps', 'livesync-hello-world.tgz')},
                       update_modules=True)
        Folder.copy(src=os.path.join(cls.app_name, 'app'), dst=cls.TEMP_FOLDER)
        Tns.platform_add_ios(attributes={'--path': cls.app_name, '--frameworkPath': IOS_PACKAGE})
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:15,代码来源:run_ios_device_tests.py

示例7: test_100_plugin_add_sandbox_pod_can_write_in_app_folder

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_ios [as 别名]
    def test_100_plugin_add_sandbox_pod_can_write_in_app_folder(self):
        Tns.create_app(self.app_name)
        Tns.platform_add_ios(attributes={"--path": self.app_name,
                                         "--frameworkPath": IOS_PACKAGE})

        plugin = os.path.join(TEST_RUN_HOME, "data", "CocoaPods", "nativescript-ios-working-with-sandbox-plugin.tgz")
        output = Tns.plugin_add(plugin, attributes={"--path": self.app_name}, assert_success=False)
        assert "Successfully installed plugin nativescript-ios-working-with-sandbox-plugin." in output
        assert "nativescript-ios-working-with-sandbox-plugin" in File.read(self.app_name + "/package.json")

        output = Tns.prepare_ios(attributes={"--path": self.app_name})
        assert "Successfully prepared plugin " + \
               "nativescript-ios-working-with-sandbox-plugin for ios." in output

        assert "content" in File.read(self.app_name + "/platforms/ios/TestApp/app/I_MADE_THIS_FILE.txt")
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:17,代码来源:plugin_ios_cocoa_pods_sandbox_tests.py

示例8: test_400_plugin_add_sandbox_pod_can_write_outside_app_folder_by_default

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_ios [as 别名]
    def test_400_plugin_add_sandbox_pod_can_write_outside_app_folder_by_default(self):
        Tns.create_app(self.app_name)
        Tns.platform_add_ios(attributes={"--path": self.app_name,
                                         "--frameworkPath": IOS_PACKAGE})

        plugin = os.path.join(TEST_RUN_HOME, "data", "CocoaPods", "nativescript-ios-fail-with-sandbox-plugin.tgz")
        output = Tns.plugin_add(plugin, attributes={"--path": self.app_name}, assert_success=False)
        assert "Successfully installed plugin nativescript-ios-fail-with-sandbox-plugin." in output
        assert "nativescript-ios-fail-with-sandbox-plugin" in File.read(self.app_name + "/package.json")

        output = Tns.prepare_ios(attributes={"--path": self.app_name}, assert_success=False)
        assert "Successfully prepared " + \
               "plugin nativescript-ios-fail-with-sandbox-plugin for ios." in output

        assert "sh: ../I_MADE_THIS_FILE.txt: Operation not permitted" not in output
        assert File.exists(self.app_name + "/platforms/I_MADE_THIS_FILE.txt")
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:18,代码来源:plugin_ios_cocoa_pods_sandbox_tests.py

示例9: test_320_platform_add_ios_custom_bundle_id

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_ios [as 别名]
    def test_320_platform_add_ios_custom_bundle_id(self):
        # Create project with different appId
        Folder.cleanup(self.app_name)
        output = Tns.create_app(self.app_name, attributes={"--appid": "org.nativescript.MyApp"}, assert_success=False)
        TnsAsserts.created(self.app_name, output=output, full_check=False)

        output = File.read(self.app_name + os.sep + "package.json")
        assert "\"id\": \"org.nativescript.MyApp\"" in output

        # Add iOS platform
        Tns.platform_add_ios(attributes={"--path": self.app_name, "--frameworkPath": IOS_PACKAGE})

        # Verify plist file in native project (after prepare)
        Tns.prepare_ios(attributes={"--path": self.app_name})
        output = File.read(self.app_name + "/platforms/ios/TestApp/TestApp-Info.plist")
        assert "org.nativescript.MyApp" in output
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:18,代码来源:platform_ios_tests.py

示例10: setUpClass

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_ios [as 别名]
 def setUpClass(cls):
     BaseClass.setUpClass(cls.__name__)
     Process.kill('Safari')
     Process.kill('NativeScript Inspector')
     Emulator.stop()
     Simulator.stop()
     cls.SIMULATOR_ID = Simulator.ensure_available(simulator_name=SIMULATOR_NAME)
     Folder.cleanup(cls.INSPECTOR_GLOBAL_PATH)
     Tns.create_app(cls.app_name,
                    attributes={'--template': os.path.join('data', 'apps', 'livesync-hello-world.tgz')},
                    update_modules=True)
     Tns.platform_add_ios(attributes={'--path': cls.app_name, '--frameworkPath': IOS_PACKAGE})
     if USE_YARN == "True":
         Npm.install(package=IOS_INSPECTOR_PACKAGE, option='--dev', folder=cls.app_name)
     else:
         Npm.install(package=IOS_INSPECTOR_PACKAGE, option='--save-dev', folder=cls.app_name)
     Tns.build_ios(attributes={"--path": cls.app_name})
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:19,代码来源:debug_ios_inspector_tests.py

示例11: test_401_plugin_add_sandbox_pod_can_not_write_outside_app_folder_if_use_pod_sandbox_is_true

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_ios [as 别名]
    def test_401_plugin_add_sandbox_pod_can_not_write_outside_app_folder_if_use_pod_sandbox_is_true(self):
        File.replace("node_modules/nativescript/config/config.json", '"USE_POD_SANDBOX": false',
                     '"USE_POD_SANDBOX": true')
        Tns.create_app(self.app_name)
        Tns.platform_add_ios(attributes={"--path": self.app_name, "--frameworkPath": IOS_PACKAGE})

        plugin = os.path.join(TEST_RUN_HOME, "data", "CocoaPods", "nativescript-ios-fail-with-sandbox-plugin.tgz")
        output = Tns.plugin_add(plugin, attributes={"--path": self.app_name}, assert_success=False)
        assert "Successfully installed plugin nativescript-ios-fail-with-sandbox-plugin." in output
        assert "nativescript-ios-fail-with-sandbox-plugin" in File.read(self.app_name + "/package.json")

        output = Tns.prepare_ios(attributes={"--path": self.app_name}, assert_success=False)
        assert "Successfully prepared " + \
               "plugin nativescript-ios-fail-with-sandbox-plugin for ios." in output

        assert "sh: ../I_MADE_THIS_FILE.txt: Operation not permitted" in output
        assert not File.exists(self.app_name + "/platforms/I_MADE_THIS_FILE.txt")
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:19,代码来源:plugin_ios_cocoa_pods_sandbox_tests.py

示例12: test_202_plugin_add_xcconfig_after_platform_add_ios

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_ios [as 别名]
    def test_202_plugin_add_xcconfig_after_platform_add_ios(self):
        Tns.platform_add_ios(attributes={"--path": self.app_name, "--frameworkPath": IOS_PACKAGE})

        plugin_path = TEST_RUN_HOME + "/data/CocoaPods/xcconfig-plugin.tgz"
        output = Tns.plugin_add(plugin_path, attributes={"--path": self.app_name}, assert_success=False)
        assert "Successfully installed plugin xcconfig-plugin." in output
        assert File.exists(self.app_name + "/node_modules/xcconfig-plugin/package.json")
        assert File.exists(self.app_name + "/node_modules/xcconfig-plugin/platforms/ios/build.xcconfig")
        assert File.exists(self.app_name + "/node_modules/xcconfig-plugin/platforms/ios/module.modulemap")
        assert File.exists(self.app_name + "/node_modules/xcconfig-plugin/platforms/ios/XcconfigPlugin.h")
        assert "xcconfig-plugin" in File.read(self.app_name + "/package.json")

        output = Tns.build_ios(attributes={"--path": self.app_name})
        assert "Successfully prepared plugin xcconfig-plugin for ios." in output

        output = File.read(self.app_name + "/platforms/ios/plugins-debug.xcconfig")
        assert "OTHER_LDFLAGS = $(inherited) -l\"sqlite3\"" in output

        output = File.read(self.app_name + "/platforms/ios/TestApp/build-debug.xcconfig")
        assert "#include \"../plugins-debug.xcconfig\"" in output
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:22,代码来源:plugin_ios_xcconfig_tests.py

示例13: test_200_platform_add_ios_framework_path

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_ios [as 别名]
    def test_200_platform_add_ios_framework_path(self):
        Tns.platform_add_ios(attributes={"--path": self.app_name, "--frameworkPath": IOS_PACKAGE})

        # If project.xcworkspace is there Xcode project name is wrong
        assert not File.exists(self.app_name + "/platforms/ios/TestApp.xcodeproj/project.xcworkspace")
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:7,代码来源:platform_ios_tests.py

示例14: test_310_platform_add_ios_custom_experimental_version

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_ios [as 别名]
 def test_310_platform_add_ios_custom_experimental_version(self):
     Tns.platform_add_ios(version="0.9.2-exp-ios-8.2", attributes={"--path": self.app_name})
     output = File.read(self.app_name + os.sep + "package.json")
     assert "\"version\": \"0.9.2-exp-ios-8.2\"" in output
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:6,代码来源:platform_ios_tests.py

示例15: test_300_platform_add_ios_custom_version

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_ios [as 别名]
 def test_300_platform_add_ios_custom_version(self):
     Tns.platform_add_ios(version="2.1.0", attributes={"--path": self.app_name})
     output = File.read(self.app_name + os.sep + "package.json")
     assert "\"version\": \"2.1.0\"" in output
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:6,代码来源:platform_ios_tests.py


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