changeset 122:961aab080239

start some regression tests
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Thu, 28 Sep 2023 10:54:12 +0100
parents f8d5e5355c4c
children 43b0509e70c0
files lib/python/cc/lmh/test/key_tests.tsv lib/python/cc/lmh/test/test_keys.py
diffstat 2 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/python/cc/lmh/test/key_tests.tsv	Thu Sep 28 10:54:12 2023 +0100
@@ -0,0 +1,5 @@
+http://www.example.com/	com,example)/
+http://futnsz.cn/?tag=www.%7Fy19799.com cn,futnsz)/?tag=www.y19799.com
+http://www.ccmmi.com.br/busca?busca=http%3A%2F%2Fvtservices85.fr%2Fsmf2%2Findex.php%3FPHPSESSID%3Dfa69565f8acb1f23da02e6729eef3643%26topic%3D126838.0&tipo=All	br,com,ccmmi)/busca?busca=http://vtservices85.fr/smf2/index.php?topic=126838.0&tipo=all
+https://www.eu-kommunal-kompass.de/index.php/foerderdatenbank?option=com_redirectpage&view=redirectpage&url=http%3A%2F%2Fwww.umweltbildung.de%2Ffileadmin%2Finhalte-projekte%2FKommune%2FANU-BNE_im_komm._KS_Abschlussbericht_pblc1b.pdf%3FPHPSESSID%3Da23dac7de24bb2f1e53978474b0d9c2d	de,eu-kommunal-kompass)/index.php/foerderdatenbank?option=com_redirectpage&url=http://www.umweltbildung.de/fileadmin/inhalte-projekte/kommune/anu-bne_im_komm._ks_abschlussbericht_pblc1b.pdf?&view=redirectpage
+http://www.televida.biz/en/customers/media/177-%7F5th-anniversary-%E2%80%9Cviva-la-ma%C3%B1ana%E2%80%9D-from-guatevision-channel.html	biz,televida)/en/customers/media/177-\x7f5th-anniversary-%e2%80%9cviva-la-ma%c3%b1ana%e2%80%9d-from-guatevision-channel.html
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/python/cc/lmh/test/test_keys.py	Thu Sep 28 10:54:12 2023 +0100
@@ -0,0 +1,13 @@
+'''Some regression tests for sort_date'''
+
+from lmh import *
+
+import os.path
+
+
+with open(os.path.join(os.path.dirname(__file__),
+                       'key_tests.tsv'),'r') as f:
+  for l in f:
+    u, k = l.split()
+    assert (kk:=cdx_key(u)) == k, "%s should be %s from %s"%(kk,k,u)
+