def test_301_build_project_with_space_release(self):

        # Ensure ANDROID_KEYSTORE_PATH contain spaces (verification for CLI issue 2650)
        Folder.create("with space")
        file_name = os.path.basename(Settings.Android.ANDROID_KEYSTORE_PATH)
        cert_with_space_path = os.path.join("with space", file_name)
        File.copy(Settings.Android.ANDROID_KEYSTORE_PATH, cert_with_space_path)

        Tns.build_android(app_name='"' + self.app_name_with_space + '"', release=True)
        output = File.read(os.path.join(self.app_name_with_space, "package.json"))
        assert self.app_identifier in output.lower()

        output = File.read(os.path.join(TnsPaths.get_platforms_android_src_main_path(self.app_name_with_space),
                                        'AndroidManifest.xml'))
        assert self.app_identifier in output.lower()
示例#2
0
    def test_450_resources_update_android(self):
        target_app = os.path.join(self.app_name, 'app', 'App_Resources')
        source_app = os.path.join(TEST_RUN_HOME, 'assets', 'apps',
                                  'test-app-js-41', 'app', 'App_Resources')
        Folder.clean(target_app)
        Folder.copy(source_app, target_app)

        result = Tns.exec_command(command='resources update android',
                                  path=self.app_name)

        assert "Successfully updated your project's application resources '/Android' directory structure" in \
               result.output
        assert "The previous version of your Android application resources has been renamed to '/Android-Pre-v4'" in \
               result.output
        assert File.exists(
            os.path.join(TnsPaths.get_path_app_resources(self.app_name),
                         'Android-Pre-v4', 'app.gradle'))
        assert File.exists(
            os.path.join(TnsPaths.get_path_app_resources(self.app_name),
                         'Android', 'app.gradle'))
        assert File.exists(
            os.path.join(
                TnsPaths.get_path_app_resources_main_android(self.app_name),
                'AndroidManifest.xml'))
        assert Folder.exists(
            os.path.join(
                TnsPaths.get_path_app_resources_main_android(self.app_name),
                'assets'))
        assert Folder.exists(
            os.path.join(
                TnsPaths.get_path_app_resources_main_android(self.app_name),
                'java'))
        assert Folder.exists(
            os.path.join(
                TnsPaths.get_path_app_resources_main_android(self.app_name),
                'res', 'values'))

        Tns.prepare_android(self.app_name)
        assert File.exists(
            os.path.join(
                TnsPaths.get_platforms_android_src_main_path(self.app_name),
                'AndroidManifest.xml'))