Пример #1
0
def test_fd():
	li = list()
	data = 'dummy data'
	with tempfile.NamedTemporaryFile(delete=False) as f:
		f.file.write(data)
	fd(f.name, collection(li))
	f.unlink(f.name)
	result = ''.join(li)
	assert result == data
Пример #2
0
def test_fd():
    li = list()
    data = 'dummy data'
    with tempfile.NamedTemporaryFile(delete=False) as f:
        f.file.write(data)
    fd(f.name, collection(li))
    f.unlink(f.name)
    result = ''.join(li)
    assert result == data
Пример #3
0
def test_iterable_with_string():
    li = list()
    iterable(u'abc', collection(li))
    for letter in 'abc':
        assert letter in li
Пример #4
0
def test_entropy_accepts_length():
    li = list()
    entropy(collection(li), 500)
    assert len(li) == 500
Пример #5
0
def test_entropy():
    li = list()
    entropy(collection(li))
    assert li
Пример #6
0
def test_collection_with_sets():
    s = set()
    iterable('abc', collection(s))
    for letter in 'abc':
        assert letter in s
Пример #7
0
def test_collection_with_lists():
    c = list()
    iterable('abc', collection(c))
    assert c == ['a', 'b', 'c']
Пример #8
0
def test_iterable_with_string():
    li = list()
    iterable(u'abc', collection(li))
    for letter in 'abc':
    	assert letter in li
Пример #9
0
def test_entropy_accepts_length():
	li = list()
	entropy(collection(li), 500)
	assert len(li) == 500
Пример #10
0
def test_entropy():
	li = list()
	entropy(collection(li))
	assert li
Пример #11
0
def test_collection_with_sets():
    s = set()
    iterable('abc', collection(s))
    for letter in 'abc':
        assert letter in s
Пример #12
0
def test_collection_with_lists():
    c = list()
    iterable('abc', collection(c))
    assert c == ['a', 'b', 'c']