Skip to content
This repository was archived by the owner on Jan 11, 2019. It is now read-only.

add index v4 #282

Merged
merged 1 commit into from
Nov 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions index-v4.yaml
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
35 changes: 35 additions & 0 deletions test/test_indexes_equal.py
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)