示例#1
0
    def test_zapp_yaml_not_exists(self):
        try:
            with mock.patch('os.getcwd') as cwd:
                cwd.return_value = self.subdir

                with pytest.raises(RuntimeError):
                    zpm.find_project_root()
        finally:
            shutil.rmtree(self.tempdir)
示例#2
0
    def test_zapp_yaml_not_exists(self):
        try:
            with mock.patch('os.getcwd') as cwd:
                cwd.return_value = self.subdir

                with pytest.raises(RuntimeError):
                    zpm.find_project_root()
        finally:
            shutil.rmtree(self.tempdir)
示例#3
0
文件: commands.py 项目: barkinet/zpm
def bundle(args):
    """Bundle a ZeroVM application

    This command creates a Zapp using the instructions in zapp.yaml.
    The file is read from the project root.
    """
    root = zpm.find_project_root()
    zpm.bundle_project(root, refresh_deps=args.refresh_deps)
示例#4
0
文件: commands.py 项目: al-maisan/zpm
def bundle(args):
    """Bundle a ZeroVM application

    This command creates a ZAR using the instructions in ``zar.json``.
    The file is read from the project root.
    """
    root = zpm.find_project_root()
    zpm.bundle_project(root)
示例#5
0
def bundle(args):
    """Bundle a ZeroVM application

    This command creates a Zapp using the instructions in zapp.yaml.
    The file is read from the project root.
    """
    root = zpm.find_project_root()
    zpm.bundle_project(root, refresh_deps=args.refresh_deps)
示例#6
0
    def test_zapp_yaml_exists(self):
        try:
            zapp_path = os.path.join(self.tempdir, 'zapp.yaml')
            # "touch" the file
            open(zapp_path, 'w').close()

            with mock.patch('os.getcwd') as cwd:
                cwd.return_value = self.subdir

                root = zpm.find_project_root()
                assert root == self.tempdir
        finally:
            shutil.rmtree(self.tempdir)
示例#7
0
    def test_zapp_yaml_exists(self):
        try:
            zapp_path = os.path.join(self.tempdir, 'zapp.yaml')
            # "touch" the file
            open(zapp_path, 'w').close()

            with mock.patch('os.getcwd') as cwd:
                cwd.return_value = self.subdir

                root = zpm.find_project_root()
                assert root == self.tempdir
        finally:
            shutil.rmtree(self.tempdir)