diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2013-12-13 16:50:32 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2014-01-10 11:37:52 +0000 |
commit | 5f5a4669161be1ca571796ef4902883b17e8d86c (patch) | |
tree | 25d113b1cdfd6520df1578410744876ffea7c59c | |
parent | 6ff6be3c0844669f9ad7f1a812be7532f6d154c5 (diff) | |
download | morph-5f5a4669161be1ca571796ef4902883b17e8d86c.tar.gz |
unit tests: Fix invalid morphologies
-rw-r--r-- | morphlib/artifact_tests.py | 4 | ||||
-rw-r--r-- | morphlib/cachekeycomputer_tests.py | 16 | ||||
-rw-r--r-- | morphlib/localartifactcache_tests.py | 4 | ||||
-rw-r--r-- | morphlib/remoteartifactcache_tests.py | 4 |
4 files changed, 15 insertions, 13 deletions
diff --git a/morphlib/artifact_tests.py b/morphlib/artifact_tests.py index 8edbbde2..d4b15cba 100644 --- a/morphlib/artifact_tests.py +++ b/morphlib/artifact_tests.py @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2013 Codethink Limited +# Copyright (C) 2012-2014 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 @@ -26,7 +26,7 @@ class ArtifactTests(unittest.TestCase): morph = morphlib.morph2.Morphology( ''' { - "chunk": "chunk", + "name": "chunk", "kind": "chunk", "chunks": { "chunk-runtime": [ diff --git a/morphlib/cachekeycomputer_tests.py b/morphlib/cachekeycomputer_tests.py index 2f033a7a..4e73e905 100644 --- a/morphlib/cachekeycomputer_tests.py +++ b/morphlib/cachekeycomputer_tests.py @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2013 Codethink Limited +# Copyright (C) 2012-2014 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 @@ -53,7 +53,8 @@ class CacheKeyComputerTests(unittest.TestCase): { "name": "chunk", "repo": "repo", - "ref": "original/ref" + "ref": "original/ref", + "build-depends": [] } ] }''', @@ -64,12 +65,14 @@ class CacheKeyComputerTests(unittest.TestCase): { "name": "chunk2", "repo": "repo", - "ref": "original/ref" + "ref": "original/ref", + "build-depends": [] }, { "name": "chunk3", "repo": "repo", - "ref": "original/ref" + "ref": "original/ref", + "build-depends": [] } ] }''', @@ -118,7 +121,6 @@ class CacheKeyComputerTests(unittest.TestCase): for artifact in self.artifacts: if artifact.name == name: return artifact - raise def test_compute_key_hashes_all_types(self): runcount = {'thing': 0, 'dict': 0, 'list': 0, 'tuple': 0} @@ -184,8 +186,8 @@ class CacheKeyComputerTests(unittest.TestCase): self.assertEqual(old_sha, new_sha) def test_same_morphology_added_to_source_pool_only_appears_once(self): - src = morphlib.source.Source('repo', 'original/ref', 'sha', 'tree', - '{"name": "chunk", "kind": "chunk"}', + m = morphlib.morph2.Morphology('{"name": "chunk", "kind": "chunk"}') + src = morphlib.source.Source('repo', 'original/ref', 'sha', 'tree', m, 'chunk.morph') sp = morphlib.sourcepool.SourcePool() sp.add(src) diff --git a/morphlib/localartifactcache_tests.py b/morphlib/localartifactcache_tests.py index d7743359..18d20612 100644 --- a/morphlib/localartifactcache_tests.py +++ b/morphlib/localartifactcache_tests.py @@ -1,4 +1,4 @@ -# Copyright (C) 2012,2013 Codethink Limited +# Copyright (C) 2012,2014 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 @@ -30,7 +30,7 @@ class LocalArtifactCacheTests(unittest.TestCase): morph = morphlib.morph2.Morphology( ''' { - "chunk": "chunk", + "name": "chunk", "kind": "chunk", "artifacts": { "chunk-runtime": [ diff --git a/morphlib/remoteartifactcache_tests.py b/morphlib/remoteartifactcache_tests.py index e7f45f58..d11bf264 100644 --- a/morphlib/remoteartifactcache_tests.py +++ b/morphlib/remoteartifactcache_tests.py @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2013 Codethink Limited +# Copyright (C) 2012-2014 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 @@ -27,7 +27,7 @@ class RemoteArtifactCacheTests(unittest.TestCase): morph = morphlib.morph2.Morphology( ''' { - "chunk": "chunk", + "name": "chunk", "kind": "chunk", "artifacts": { "chunk-runtime": [ |