~panda-roux/MoonGem

ref: 95734358a15cb6229e3b2ddbe33a44527472cec4 MoonGem/test/test.py -rw-r--r-- 521 bytes
95734358 — panda-roux fixing a potential memory leak 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import test_definitions as td
import ignition as ig
import sys

tests = {
    'empty.gmi':      td.exists,
    'does_not_exist.gmi': td.does_not_exist
}

def main():
    for route, func in tests.items():
        response = ig.request(f'//localhost:1966/{route}')
        passed, msg = func(response)
        if not passed:
            print(f'[{func.__name__}] failed ({route}): {msg}') 
            sys.exit(-1)
        else:
            print(f'{func.__name__} passed ({route})')

if __name__ == '__main__':
    main()