From c194aeef2eded50948ccdff82e4a26ba4338dffc Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Fri, 22 Mar 2024 14:43:35 -0500 Subject: [PATCH] Create a fake rosdistro index for better test isolation The tests currently require the rosdistro index to be reachable. --- test/__init__.py | 6 ++++++ test/fake_rosdistro/index-v4.yaml | 10 ++++++++++ test/fake_rosdistro/melodic/distribution.yaml | 10 ++++++++++ 3 files changed, 26 insertions(+) create mode 100644 test/fake_rosdistro/index-v4.yaml create mode 100644 test/fake_rosdistro/melodic/distribution.yaml diff --git a/test/__init__.py b/test/__init__.py index bedf6be4..1d2abcc8 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -1,5 +1,11 @@ import os +os.environ['ROSDISTRO_INDEX_URL'] = 'file://' + os.path.join( + os.path.dirname(os.path.abspath(__file__)), + 'fake_rosdistro', + 'index-v4.yaml', +) + user_email = 'test@example.com' user_name = 'Test User' diff --git a/test/fake_rosdistro/index-v4.yaml b/test/fake_rosdistro/index-v4.yaml new file mode 100644 index 00000000..843e3637 --- /dev/null +++ b/test/fake_rosdistro/index-v4.yaml @@ -0,0 +1,10 @@ +%YAML 1.1 +--- +distributions: + melodic: + distribution: [melodic/distribution.yaml] + distribution_status: end-of-life + distribution_type: ros1 + python_version: 2 +type: index +version: 4 diff --git a/test/fake_rosdistro/melodic/distribution.yaml b/test/fake_rosdistro/melodic/distribution.yaml new file mode 100644 index 00000000..42b41337 --- /dev/null +++ b/test/fake_rosdistro/melodic/distribution.yaml @@ -0,0 +1,10 @@ +%YAML 1.1 +--- +release_platforms: + debian: + - buster + ubuntu: + - bionic +repositories: [] +type: distribution +version: 2