This repository was archived by the owner on Jan 11, 2019. It is now read-only.
forked from ros/rosdistro
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add v4 index, add test to ensure both indexed stay in sync
- Loading branch information
1 parent
ff71839
commit afde9f7
Showing
2 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
%YAML 1.1 | ||
# ROS index file | ||
# see REP 153: http://ros.org/reps/rep-0153.html | ||
--- | ||
distributions: | ||
# r2b2: | ||
# distribution: [r2b2/distribution.yaml] | ||
# distribution_cache: http://repo.ros2.org/rosdistro_cache/r2b2-cache.yaml.gz | ||
# r2b3: | ||
# distribution: [r2b3/distribution.yaml] | ||
# distribution_cache: http://repo.ros2.org/rosdistro_cache/r2b3-cache.yaml.gz | ||
ardent: | ||
distribution: [ardent/distribution.yaml] | ||
distribution_cache: http://repo.ros2.org/rosdistro_cache/ardent-cache.yaml.gz | ||
distribution_status: active | ||
distribution_type: ros2 | ||
bouncy: | ||
distribution: [bouncy/distribution.yaml] | ||
distribution_cache: http://repo.ros2.org/rosdistro_cache/bouncy-cache.yaml.gz | ||
distribution_status: active | ||
distribution_type: ros2 | ||
type: index | ||
version: 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import os | ||
|
||
from rosdistro import get_index | ||
|
||
from .fold_block import Fold | ||
|
||
INDEX_V3_YAML = os.path.normpath(os.path.join( | ||
os.path.dirname(os.path.abspath(__file__)), '..', 'index.yaml')) | ||
INDEX_V4_YAML = os.path.normpath(os.path.join( | ||
os.path.dirname(os.path.abspath(__file__)), '..', 'index-v4.yaml')) | ||
|
||
|
||
def test_build_caches(): | ||
with Fold(): | ||
print('Checking that the index.yaml and index-v4.yaml files contain ' | ||
'the same information expect additional metadata in the v4.') | ||
index_v3 = get_index('file://' + os.path.abspath(INDEX_V3_YAML)) | ||
index_v4 = get_index('file://' + os.path.abspath(INDEX_V4_YAML)) | ||
|
||
dist_names_v3 = list(sorted(index_v3.distributions.keys())) | ||
dist_names_v4 = list(sorted(index_v4.distributions.keys())) | ||
assert dist_names_v3 == dist_names_v4, \ | ||
'Different set of distribution names' | ||
|
||
for dist_name in dist_names_v3: | ||
dist_v3_data = index_v3.distributions[dist_name] | ||
dist_v4_data = index_v4.distributions[dist_name] | ||
|
||
for key, value in dist_v3_data.items(): | ||
assert key in dist_v4_data, \ | ||
"For distribution '%s' index.yaml contains the key '%s' " \ | ||
"but v4 doesn't contain it" % (dist_name, key) | ||
assert dist_v4_data[key] == value, \ | ||
"For distribution '%s' both yaml files contains the key " \ | ||
"'%s' but with different values" % (dist_name, key) |