Example #1
0
    def test_must_return_dirs(self):
        source_dir = "source"
        manifest_dir = "manifest"

        result = LambdaBuildContainer._get_container_dirs(
            source_dir, manifest_dir)

        self.assertEquals(
            result, {
                "source_dir": "/tmp/samcli/source",
                "manifest_dir": "/tmp/samcli/manifest",
                "artifacts_dir": "/tmp/samcli/artifacts",
                "scratch_dir": "/tmp/samcli/scratch",
            })
    def test_must_override_manifest_if_equal_to_source(self):
        source_dir = "/home/source"
        manifest_dir = "/home/source"

        result = LambdaBuildContainer._get_container_dirs(source_dir, manifest_dir)

        self.assertEqual(
            result,
            {
                # When source & manifest directories are the same, manifest_dir must be equal to source
                "source_dir": "/tmp/samcli/source",
                "manifest_dir": "/tmp/samcli/source",
                "artifacts_dir": "/tmp/samcli/artifacts",
                "scratch_dir": "/tmp/samcli/scratch",
            },
        )