diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2019-01-11 16:13:00 -0500 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2019-01-16 18:35:21 -0500 |
commit | f712aaa552e11834d0c156661309e78b8747a81c (patch) | |
tree | 2ec3284e3abcf4ed02483269546f4e9b283f580b | |
parent | 42150422f0c04a3ea5d418713b87fdc2db960567 (diff) | |
download | buildstream-f712aaa552e11834d0c156661309e78b8747a81c.tar.gz |
tests: Migrate internal Loader basic test to internals directory
-rw-r--r-- | tests/internals/loader.py (renamed from tests/loader/basics.py) | 17 | ||||
-rw-r--r-- | tests/internals/loader/onefile/elements/badfile.bst (renamed from tests/loader/basics/onefile/elements/badfile.bst) | 0 | ||||
-rw-r--r-- | tests/internals/loader/onefile/elements/badreference.bst (renamed from tests/loader/basics/onefile/elements/badreference.bst) | 0 | ||||
-rw-r--r-- | tests/internals/loader/onefile/elements/invalidkey.bst (renamed from tests/loader/basics/onefile/elements/invalidkey.bst) | 0 | ||||
-rw-r--r-- | tests/internals/loader/onefile/elements/invalidsourcekey.bst (renamed from tests/loader/basics/onefile/elements/invalidsourcekey.bst) | 0 | ||||
-rw-r--r-- | tests/internals/loader/onefile/elements/onefile.bst (renamed from tests/loader/basics/onefile/elements/onefile.bst) | 0 | ||||
-rw-r--r-- | tests/internals/loader/onefile/project.conf (renamed from tests/loader/basics/onefile/project.conf) | 0 |
7 files changed, 15 insertions, 2 deletions
diff --git a/tests/loader/basics.py b/tests/internals/loader.py index d7fc28f83..87a5c3b35 100644 --- a/tests/loader/basics.py +++ b/tests/internals/loader.py @@ -2,15 +2,28 @@ import os import pytest from buildstream._exceptions import LoadError, LoadErrorReason +from buildstream._context import Context +from buildstream._project import Project from buildstream._loader import Loader, MetaElement -from . import make_loader DATA_DIR = os.path.join( os.path.dirname(os.path.realpath(__file__)), - 'basics', + 'loader', ) +def dummy_handler(message, context): + pass + + +def make_loader(basedir): + context = Context() + context.load(config=os.devnull) + context.set_message_handler(dummy_handler) + project = Project(basedir, context) + return project.loader + + ############################################################## # Basics: Test behavior loading the simplest of projects # ############################################################## diff --git a/tests/loader/basics/onefile/elements/badfile.bst b/tests/internals/loader/onefile/elements/badfile.bst index df68dbf2a..df68dbf2a 100644 --- a/tests/loader/basics/onefile/elements/badfile.bst +++ b/tests/internals/loader/onefile/elements/badfile.bst diff --git a/tests/loader/basics/onefile/elements/badreference.bst b/tests/internals/loader/onefile/elements/badreference.bst index 9d320b2bf..9d320b2bf 100644 --- a/tests/loader/basics/onefile/elements/badreference.bst +++ b/tests/internals/loader/onefile/elements/badreference.bst diff --git a/tests/loader/basics/onefile/elements/invalidkey.bst b/tests/internals/loader/onefile/elements/invalidkey.bst index 5674ab7bd..5674ab7bd 100644 --- a/tests/loader/basics/onefile/elements/invalidkey.bst +++ b/tests/internals/loader/onefile/elements/invalidkey.bst diff --git a/tests/loader/basics/onefile/elements/invalidsourcekey.bst b/tests/internals/loader/onefile/elements/invalidsourcekey.bst index 5677af347..5677af347 100644 --- a/tests/loader/basics/onefile/elements/invalidsourcekey.bst +++ b/tests/internals/loader/onefile/elements/invalidsourcekey.bst diff --git a/tests/loader/basics/onefile/elements/onefile.bst b/tests/internals/loader/onefile/elements/onefile.bst index ae4950585..ae4950585 100644 --- a/tests/loader/basics/onefile/elements/onefile.bst +++ b/tests/internals/loader/onefile/elements/onefile.bst diff --git a/tests/loader/basics/onefile/project.conf b/tests/internals/loader/onefile/project.conf index afa0f5475..afa0f5475 100644 --- a/tests/loader/basics/onefile/project.conf +++ b/tests/internals/loader/onefile/project.conf |