Changeset 6772014 in rtems-central


Ignore:
Timestamp:
May 6, 2020, 9:11:20 AM (6 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
fa46b668
Parents:
aab2f5e
git-author:
Sebastian Huber <sebastian.huber@…> (05/06/20 09:11:20)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/28/20 08:37:29)
Message:

rtemsqual/tests/util: New module

Location:
rtemsqual/tests
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • rtemsqual/tests/test_items_itemcache.py

    raab2f5e r6772014  
    2727import os
    2828import pytest
    29 import shutil
    3029
    3130from rtemsqual.items import ItemCache, ItemMapper, ItemTemplate
     31from rtemsqual.tests.util import create_item_cache_config_and_copy_spec
    3232
    3333
     
    3737
    3838
    39 def _create_spec_and_config(tmpdir):
    40     config = {}
    41     cache_dir = os.path.join(tmpdir, "cache")
    42     config["cache-directory"] = os.path.normpath(cache_dir)
    43     spec_src = os.path.join(os.path.dirname(__file__), "spec-item-cache")
    44     spec_dst = os.path.join(tmpdir, "spec")
    45     shutil.copytree(spec_src, spec_dst)
    46     config["paths"] = [os.path.normpath(spec_dst)]
    47     return config
    48 
    49 
    5039def test_load(tmpdir):
    51     config = _create_spec_and_config(tmpdir)
     40    config = create_item_cache_config_and_copy_spec(tmpdir, "spec-item-cache")
    5241    item_cache = ItemCache(config)
    5342    cache_dir = config["cache-directory"]
     
    9483
    9584def test_item_mapper(tmpdir):
    96     config = _create_spec_and_config(tmpdir)
     85    config = create_item_cache_config_and_copy_spec(tmpdir, "spec-item-cache")
    9786    item_cache = ItemCache(config)
    9887    item = item_cache["/p"]
Note: See TracChangeset for help on using the changeset viewer.