File: test_collections_extended.py

package info (click to toggle)
python-collections-extended 2.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 492 kB
  • sloc: python: 2,917; makefile: 59
file content (24 lines) | stat: -rw-r--r-- 671 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""Test for collections_extended factory."""

from collections_extended import (
	collection,
	bag,
	setlist,
	frozenbag,
	frozensetlist,
	)


def test_collection_factory():
	"""Test collection factory."""
	assert type(collection()) == bag
	assert type(collection(ordered=True)) == list
	assert type(collection(unique=True)) == set
	assert type(collection(unique=True, ordered=True)) == setlist
	assert type(collection(mutable=False)) == frozenbag
	assert type(collection(mutable=False, ordered=True)) == tuple
	assert type(collection(mutable=False, unique=True)) == frozenset
	assert (
		type(collection(mutable=False, unique=True, ordered=True)) ==
		frozensetlist
		)