MCPcopy
hub / github.com/caronc/apprise / test_parse_list

Function test_parse_list

tests/test_apprise_utils.py:2392–2488  ·  view source on GitHub ↗

utils: parse_list() testing

()

Source from the content-addressed store, hash-verified

2390
2391
2392def test_parse_list():
2393 """utils: parse_list() testing"""
2394
2395 # A simple single array entry (As str)
2396 results = utils.parse.parse_list(
2397 ".mkv,.avi,.divx,.xvid,.mov,.wmv,.mp4,.mpg,.mpeg,.vob,.iso"
2398 )
2399
2400 assert results == sorted(
2401 [
2402 ".divx",
2403 ".iso",
2404 ".mkv",
2405 ".mov",
2406 ".mpg",
2407 ".avi",
2408 ".mpeg",
2409 ".vob",
2410 ".xvid",
2411 ".wmv",
2412 ".mp4",
2413 ]
2414 )
2415
2416 class StrangeObject:
2417 def __str__(self):
2418 return ".avi"
2419
2420 # Now 2 lists with lots of duplicates and other delimiters
2421 results = utils.parse.parse_list(
2422 ".mkv,.avi,.divx,.xvid,.mov,.wmv,.mp4,.mpg .mpeg,.vob,,; ;",
2423 (".mkv,.avi,.divx,.xvid,.mov ", " .wmv,.mp4;.mpg,.mpeg,"),
2424 ".vob,.iso",
2425 [
2426 ".vob",
2427 [
2428 ".vob",
2429 ".mkv",
2430 StrangeObject(),
2431 ],
2432 ],
2433 StrangeObject(),
2434 )
2435
2436 assert results == sorted(
2437 [
2438 ".divx",
2439 ".iso",
2440 ".mkv",
2441 ".mov",
2442 ".mpg",
2443 ".avi",
2444 ".mpeg",
2445 ".vob",
2446 ".xvid",
2447 ".wmv",
2448 ".mp4",
2449 ]

Callers

nothing calls this directly

Calls 2

StrangeObjectClass · 0.85
parse_listMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…