changeset 131:fd16e8fb9223

add test description
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Thu, 28 Sep 2023 16:36:15 +0100
parents 31abd509e365
children 417d2986c99c
files lib/python/cc/lmh/test/key_tests.tsv lib/python/cc/lmh/test/test_keys.py
diffstat 2 files changed, 11 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lib/python/cc/lmh/test/key_tests.tsv	Thu Sep 28 16:35:39 2023 +0100
+++ b/lib/python/cc/lmh/test/key_tests.tsv	Thu Sep 28 16:36:15 2023 +0100
@@ -1,5 +1,6 @@
-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
+Vanilla	http://www.example.com/	com,example)/
+x7f in query	http://futnsz.cn/?tag=www.%7Fy19799.com	cn,futnsz)/?tag=www.y19799.com
+Non-final PHPSESSIONID	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
+Final PHPSESSIONID in quoted URI	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
+x7f raw in path	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
+Not octal IPv4	http://143.107.225.017/	17,225,107,143)/
\ No newline at end of file
--- a/lib/python/cc/lmh/test/test_keys.py	Thu Sep 28 16:35:39 2023 +0100
+++ b/lib/python/cc/lmh/test/test_keys.py	Thu Sep 28 16:36:15 2023 +0100
@@ -1,6 +1,6 @@
 '''Some regression tests for sort_date'''
 
-from lmh import *
+from cc.lmh import *
 
 import os.path
 
@@ -9,10 +9,11 @@
                        'key_tests.tsv'),'r') as f:
   i = 0
   for l in f:
+    if l[0] in '#\n':
+      continue
     i+=1
-    u, k = l.split()
+    d, u, k = l.rstrip().split('\t')
     kk = cdx_key(u)
     if kk == k:
       continue
-    print("Test %s failed:\n%s should be\n%s\nfrom %s"%(i,kk,k,u))
-
+    print("Test %s: %s failed:\n%s should be\n%s\nfrom %s"%(i,d,kk,k,u))