def test_adv_resources(self, tmpdir, manifest):
        """
        Given fly cli arguments, generate: 
        1. pipelinemanifest.yml
        """

        cpm(self.cli_args)

        assert os.path.isfile(manifest["generated"])
        #assert filecmp.cmp(manifest, manifest_validation)
        assert manifest["generated"].read() == manifest["expected"].read()

        pipeline_to_validate = manifest["tmpdir"].join(
            './pipelines_files/config_files/Test 3.yml')
        pipeline_to_expect = manifest["tmpdir"].join(
            './pipelines_validation/pipelines_files/config_files/Test 3.yml')
        assert os.path.isfile(pipeline_to_validate)
        assert pipeline_to_validate.read() == pipeline_to_expect.read()

        pipeline_to_validate = manifest["tmpdir"].join(
            './pipelines_files/config_files/Test 4.yml')
        pipeline_to_expect = manifest["tmpdir"].join(
            './pipelines_validation/pipelines_files/config_files/Test 4.yml')
        assert os.path.isfile(pipeline_to_validate)
        assert pipeline_to_validate.read() == pipeline_to_expect.read()
    def test_base_config(self, tmpdir, manifest):
        """
        A config section can be use as a boilerplate for all pipeline 
        """

        cpm(self.cli_args)

        assert os.path.isfile(manifest["generated"])
        assert manifest["generated"].read() == manifest["expected"].read()
    def test_base(self, tmpdir, manifest):
        """
        Given fly cli arguments, generate: 
        1. pipelinemanifest.yml
        """

        cpm(self.cli_args)

        assert os.path.isfile(manifest["generated"])
        #assert filecmp.cmp(manifest, manifest_validation)
        assert manifest["generated"].read() == manifest["expected"].read()
    def test_adv_config_ci(self, tmpdir, manifest):
        """
        argument --cli
        generate set_{pipeline}.cmd
        """

        cli_args = self.cli_args.copy()

        cli_args["--ci"] = "git-infra-res"

        cpm(cli_args)

        assert os.path.isfile(manifest["generated"])
        assert manifest["generated"].read() == manifest["expected"].read()
    def test_adv_config_replace(self, tmpdir, manifest):
        """
        argument --cli
        generate set_{pipeline}.cmd
        """

        cli_args = self.cli_args.copy()

        cli_args["-p"] = ["concourse:pipelines_assets"]

        cpm(cli_args)

        assert os.path.isfile(manifest["generated"])
        assert manifest["generated"].read() == manifest["expected"].read()
    def test_base_cli(self, tmpdir, manifest):
        """
        argument --cli
        generate set_{pipeline}.cmd
        """

        cli_args = self.cli_args.copy()

        cli_args["--cli"] = "cmd"

        cpm(cli_args)

        assert os.path.isfile(manifest["generated"])
        assert manifest["generated"].read() == manifest["expected"].read()

        assert os.path.isfile(tmpdir.join('./set-pipelines/Test 1.cmd'))
        assert os.path.isfile(tmpdir.join('./set-pipelines/Test 2.cmd'))
    def test_base_copy(self, tmpdir, manifest):
        """
        argument --cli
        generate set_{pipeline}.cmd
        """

        cli_args = self.cli_args.copy()

        cli_args["--copy"] = True

        cpm(cli_args)

        assert os.path.isfile(manifest["generated"])
        assert manifest["generated"].read() == manifest["expected"].read()

        assert os.path.isfile(
            tmpdir.join('./pipelines_files/config_files/Test 1.yml'))
        assert os.path.isfile(
            tmpdir.join('./pipelines_files/config_files/Test 2.yml'))