summaryrefslogtreecommitdiff
path: root/morphlib/artifact_tests.py
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2013-02-25 10:13:34 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2013-03-13 15:20:02 +0000
commit0cc3de60d6282d22108ea59f169a0749be5e59ea (patch)
tree2bef9ed79c0b4d9e128b3095e72ccce4a525a532 /morphlib/artifact_tests.py
parent84807d4d7c23f45d4f0a0f87e6c7ba7ba7470936 (diff)
downloadmorph-0cc3de60d6282d22108ea59f169a0749be5e59ea.tar.gz
Add 'prefix' property for chunks within strata
Morph no longer supports setting the prefix using the --prefix argument / setting. This was only used in tests and during bootstrap. If a chunk build-depends on a chunk within a stratum which has a custom prefix, that prefix is appended to the PATH in the build environment.
Diffstat (limited to 'morphlib/artifact_tests.py')
-rw-r--r--morphlib/artifact_tests.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/morphlib/artifact_tests.py b/morphlib/artifact_tests.py
index 1d9e6cca..8edbbde2 100644
--- a/morphlib/artifact_tests.py
+++ b/morphlib/artifact_tests.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2012 Codethink Limited
+# Copyright (C) 2012-2013 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -14,6 +14,7 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+import copy
import unittest
import morphlib
@@ -78,3 +79,12 @@ class ArtifactTests(unittest.TestCase):
self.assertEqual(self.artifact.dependencies, [self.other])
self.assertEqual(self.other.dependents, [self.artifact])
self.assertTrue(self.artifact.depends_on(self.other))
+
+ def test_get_dependency_prefix(self):
+ self.artifact.add_dependency(self.other)
+ self.artifact.source.prefix = '/bar'
+ self.other.source = copy.copy(self.artifact.source)
+ self.other.source.prefix = '/foo'
+
+ prefix_set = self.artifact.get_dependency_prefix_set()
+ self.assertEqual(prefix_set, set(['/foo']))