Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_fromkeys():
mapping = [(val, pos) for pos, val in enumerate(string.ascii_lowercase)]
temp = SortedDict.fromkeys(mapping, 1)
assert all(temp[key] == 1 for key in temp)
sdict = SortedDict()
sdict._check()
sdict = SortedDict()
sdict._reset(17)
sdict._check()
sdict = SortedDict((val, -val) for val in range(10000))
sdict._check()
assert all(key == -val for key, val in sdict.items())
sdict.clear()
sdict._check()
assert len(sdict) == 0
sdict = SortedDict.fromkeys(range(1000), None)
assert all(sdict[key] == None for key in range(1000))