diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2012-08-24 18:05:16 +0100 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2012-08-24 18:05:16 +0100 |
commit | 3525f81ecea60f53d3ef842c1e11c4cab1538511 (patch) | |
tree | ea49c69e6baa1a000c78b3156eb5965c72ed68fd /morphlib/buildsystem_tests.py | |
parent | 98b802e36b2a291b39dbdb83b55546b1acae1573 (diff) | |
download | morph-3525f81ecea60f53d3ef842c1e11c4cab1538511.tar.gz |
Refactor build system code for easier testing
Diffstat (limited to 'morphlib/buildsystem_tests.py')
-rw-r--r-- | morphlib/buildsystem_tests.py | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/morphlib/buildsystem_tests.py b/morphlib/buildsystem_tests.py index 53b4fc17..fa7f36f7 100644 --- a/morphlib/buildsystem_tests.py +++ b/morphlib/buildsystem_tests.py @@ -59,14 +59,10 @@ class ManualBuildSystemTests(unittest.TestCase): self.bs = morphlib.buildsystem.ManualBuildSystem() def test_does_not_autodetect_empty(self): - def exists(filename): - return filename in manual_project - self.assertFalse(self.bs.used_by_project(exists)) + self.assertFalse(self.bs.used_by_project(manual_project)) def test_does_not_autodetect_autotools(self): - def exists(filename): - return filename in autotools_project - self.assertFalse(self.bs.used_by_project(exists)) + self.assertFalse(self.bs.used_by_project(autotools_project)) class DummyBuildSystemTests(unittest.TestCase): @@ -75,14 +71,10 @@ class DummyBuildSystemTests(unittest.TestCase): self.bs = morphlib.buildsystem.DummyBuildSystem() def test_does_not_autodetect_empty(self): - def exists(filename): - return filename in manual_project - self.assertFalse(self.bs.used_by_project(exists)) + self.assertFalse(self.bs.used_by_project(manual_project)) def test_does_not_autodetect_autotools(self): - def exists(filename): - return filename in autotools_project - self.assertFalse(self.bs.used_by_project(exists)) + self.assertFalse(self.bs.used_by_project(autotools_project)) class AutotoolsBuildSystemTests(unittest.TestCase): @@ -91,14 +83,10 @@ class AutotoolsBuildSystemTests(unittest.TestCase): self.bs = morphlib.buildsystem.AutotoolsBuildSystem() def test_does_not_autodetect_empty(self): - def exists(filename): - return filename in manual_project - self.assertFalse(self.bs.used_by_project(exists)) + self.assertFalse(self.bs.used_by_project(manual_project)) def test_autodetects_autotools(self): - def exists(filename): - return filename in autotools_project - self.assertTrue(self.bs.used_by_project(exists)) + self.assertTrue(self.bs.used_by_project(autotools_project)) class DetectBuildSystemTests(unittest.TestCase): |