includehandler: Fold GlobalIncludes into IncludeHandler class

No user for this abstraction in sight.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Jan Kiszka
2018-08-24 19:17:54 +02:00
committed by Daniel Wagner
parent 76e7339fdb
commit 5c28272d73
3 changed files with 19 additions and 30 deletions

View File

@@ -129,7 +129,7 @@ class TestLoadConfig:
includehandler.load_config('x.yml')
class TestGlobalIncludes:
class TestIncludes:
header = '''
header:
version: 5
@@ -140,7 +140,7 @@ header:
monkeypatch.setattr(includehandler, 'CONFIGSCHEMA', {})
for test in testvector:
with patch_open(includehandler, dictionary=test['fdict']):
ginc = includehandler.GlobalIncludes('x.yml')
ginc = includehandler.IncludeHandler('x.yml')
config, missing = ginc.get_config(repos=test['rdict'])
# Remove header, because we dont want to compare it:
@@ -348,7 +348,7 @@ v: {v2: y, v3: y, v5: y}'''),
os.path.abspath('z.yml'): header.format('''
v: {v3: z, v4: z}''')}
with patch_open(includehandler, dictionary=data):
ginc = includehandler.GlobalIncludes('x.yml')
ginc = includehandler.IncludeHandler('x.yml')
config, _ = ginc.get_config()
keys = list(config['v'].keys())
index = {keys[i]: i for i in range(len(keys))}