Author: gstein
Date: Sat May 11 02:35:51 2024
New Revision: 1917658
URL: http://svn.apache.org/viewvc?rev=1917658&view=rev
Log:
Test some basic option fetching.
* tools/hook-scripts/mailer/tests/mailer-t3.py:
(test_config_parsing): output values for to/from_addr in order to
test extraction and mapping.
* tools/hook-scripts/mailer/tests/t3/t3-fragment.conf:
(): new file to append to asf-mailer.conf in order to perform the
above testing of value extraction.
Added:
subversion/trunk/tools/hook-scripts/mailer/tests/t3/t3-fragment.conf
Modified:
subversion/trunk/tools/hook-scripts/mailer/tests/mailer-t3.py
Modified: subversion/trunk/tools/hook-scripts/mailer/tests/mailer-t3.py
URL:
http://svn.apache.org/viewvc/subversion/trunk/tools/hook-scripts/mailer/tests/mailer-t3.py?rev=1917658&r1=1917657&r2=1917658&view=diff
==============================================================================
--- subversion/trunk/tools/hook-scripts/mailer/tests/mailer-t3.py (original)
+++ subversion/trunk/tools/hook-scripts/mailer/tests/mailer-t3.py Sat May 11
02:35:51 2024
@@ -55,6 +55,12 @@ def test_config_parsing(repos_dir):
pprint.pprint(sorted(d for d in dir(cfg.maps) if not d.startswith('_')),
stream=fp)
pprint.pprint(cfg._group_re, stream=fp)
+ # Try some particular lookups.
+ groups = cfg.which_groups('/some/path', None)
+ pprint.pprint(groups, stream=fp)
+ pprint.pprint(cfg.get('to_addr', 't3-repos-1', groups[0][1]), stream=fp)
+ pprint.pprint(cfg.get('from_addr', 't3-repos-1', groups[0][1]), stream=fp)
+
if __name__ == '__main__':
repos_dir = pathlib.Path(sys.argv[1])
Added: subversion/trunk/tools/hook-scripts/mailer/tests/t3/t3-fragment.conf
URL:
http://svn.apache.org/viewvc/subversion/trunk/tools/hook-scripts/mailer/tests/t3/t3-fragment.conf?rev=1917658&view=auto
==============================================================================
--- subversion/trunk/tools/hook-scripts/mailer/tests/t3/t3-fragment.conf (added)
+++ subversion/trunk/tools/hook-scripts/mailer/tests/t3/t3-fragment.conf Sat
May 11 02:35:51 2024
@@ -0,0 +1,18 @@
+#
+# Append this to the original asf-mailer.conf, to produce a new version
+# for particular T3 testing.
+#
+
+[maps]
+to_addr = [mailing-lists]
+from_addr = [authors]
+
+[mailing-lists]
[email protected] = [email protected]
+
+[authors]
+john = [email protected]
+
+[t3-repos-1]
+to_addr = [email protected]
+from_addr = john