runfiles: Add proper test coverage for an edge case (#1012)
The repo mapping wasn't set up correctly to actually test that root
symlinks aren't subject to repo mapping.
diff --git a/tests/runfiles/runfiles_test.py b/tests/runfiles/runfiles_test.py
index 9fa2a18..3a1f492 100644
--- a/tests/runfiles/runfiles_test.py
+++ b/tests/runfiles/runfiles_test.py
@@ -208,9 +208,11 @@
def testManifestBasedRlocationWithRepoMappingFromMain(self):
with _MockFile(
contents=[
+ ",config.json,config.json~1.2.3",
",my_module,_main",
",my_protobuf,protobuf~3.19.2",
",my_workspace,_main",
+ "protobuf~3.19.2,config.json,config.json~1.2.3",
"protobuf~3.19.2,protobuf,protobuf~3.19.2",
]
) as rm, _MockFile(
@@ -281,9 +283,11 @@
def testManifestBasedRlocationWithRepoMappingFromOtherRepo(self):
with _MockFile(
contents=[
+ ",config.json,config.json~1.2.3",
",my_module,_main",
",my_protobuf,protobuf~3.19.2",
",my_workspace,_main",
+ "protobuf~3.19.2,config.json,config.json~1.2.3",
"protobuf~3.19.2,protobuf,protobuf~3.19.2",
]
) as rm, _MockFile(
@@ -374,9 +378,11 @@
with _MockFile(
name="_repo_mapping",
contents=[
+ "_,config.json,config.json~1.2.3",
",my_module,_main",
",my_protobuf,protobuf~3.19.2",
",my_workspace,_main",
+ "protobuf~3.19.2,config.json,config.json~1.2.3",
"protobuf~3.19.2,protobuf,protobuf~3.19.2",
],
) as rm:
@@ -439,9 +445,11 @@
with _MockFile(
name="_repo_mapping",
contents=[
+ "_,config.json,config.json~1.2.3",
",my_module,_main",
",my_protobuf,protobuf~3.19.2",
",my_workspace,_main",
+ "protobuf~3.19.2,config.json,config.json~1.2.3",
"protobuf~3.19.2,protobuf,protobuf~3.19.2",
],
) as rm: