Skip to content

Commit

Permalink
tests: insteadOf unittest
Browse files Browse the repository at this point in the history
Rewrite fake url to correct url with insteadOf option
to make sure it's effective

Signed-off-by: David Rozé <[email protected]>
  • Loading branch information
david-baylibre committed Jul 3, 2024
1 parent 1ed4de8 commit 79917a4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions repo_resource/test_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ def setUp(self):
'name': 'aosp_device_fixed.xml'
}
}
self.demo_manifests_to_rewrite_source = {
'source': {
'url':
'https://unreachable-github.com/makohoek/demo-manifests.git',
'revision': 'main',
'name': 'aosp_device_fixed.xml',
'insteadOf': {
'https://github.com':
'https://unreachable-github.com'
},
},
}
self.demo_manifests_source_norev = {
'source': {
'url': 'https://github.com/makohoek/demo-manifests.git',
Expand Down Expand Up @@ -92,6 +104,11 @@ def test_unreachable_manifest(self):
with self.assertRaises(repo.error.GitError):
check.check(instream)

def test_rewrite_manifest(self):
rewrite_url_data = self.demo_manifests_to_rewrite_source
instream = StringIO(json.dumps(rewrite_url_data))
check.check(instream)

def test_unknown_revision(self):
unknown_revision_data = self.aosp_platform_source
unknown_revision_data['source']['revision'] = 'unknown'
Expand Down

0 comments on commit 79917a4

Please sign in to comment.