|
3 | 3 | from inform import ( |
4 | 4 | Color, Error, Info, LoggingCache, columns, conjoin, did_you_mean, comment, |
5 | 5 | cull, dedent, display, done, error, fatal, fmt, full_stop, indent, Inform, |
6 | | - is_collection, is_iterable, is_mapping, is_str, join, get_prog_name, |
7 | | - get_informer, narrate, os_error, output, plural, render, terminate, |
8 | | - title_case, tree, truth, warn, ddd, ppp, sss, vvv, ProgressBar, parse_range, |
9 | | - format_range |
| 6 | + is_collection, is_iterable, is_mapping, is_array, is_str, join, |
| 7 | + get_prog_name, get_informer, narrate, os_error, output, plural, render, |
| 8 | + terminate, title_case, tree, truth, warn, ddd, ppp, sss, vvv, ProgressBar, |
| 9 | + parse_range, format_range |
10 | 10 | ) |
11 | 11 | from textwrap import dedent as tw_dedent |
12 | 12 | import sys |
@@ -795,20 +795,31 @@ def test_is_iterable(): |
795 | 795 | assert is_iterable([]) == True |
796 | 796 | assert is_iterable(()) == True |
797 | 797 | assert is_iterable({}) == True |
| 798 | + assert is_iterable(set()) == True |
798 | 799 |
|
799 | 800 | def test_is_collection(): |
800 | 801 | assert is_collection(0) == False |
801 | 802 | assert is_collection('') == False |
802 | 803 | assert is_collection([]) == True |
803 | 804 | assert is_collection(()) == True |
804 | 805 | assert is_collection({}) == True |
| 806 | + assert is_collection(set()) == True |
805 | 807 |
|
806 | 808 | def test_is_mapping(): |
807 | 809 | assert is_mapping(0) == False |
808 | 810 | assert is_mapping('') == False |
809 | 811 | assert is_mapping([]) == False |
810 | 812 | assert is_mapping(()) == False |
811 | 813 | assert is_mapping({}) == True |
| 814 | + assert is_mapping(set()) == False |
| 815 | + |
| 816 | +def test_is_array(): |
| 817 | + assert is_array(0) == False |
| 818 | + assert is_array('') == False |
| 819 | + assert is_array([]) == True |
| 820 | + assert is_array(()) == True |
| 821 | + assert is_array({}) == False |
| 822 | + assert is_array(set()) == False |
812 | 823 |
|
813 | 824 | def test_color(): |
814 | 825 | assert Color('white', scheme='dark')('') == '' |
|
0 commit comments