예제 #1
0
파일: test_sinks.py 프로젝트: timClicks/cop
def test_writer_supports_multiple_modes():
    f = StringIO()
    iterable('123', writer(f, 'writelines'))
    f.seek(0)
    result = f.read()
    print result
    assert result == '123'
예제 #2
0
파일: test_sinks.py 프로젝트: timClicks/cop
def test_writer_supports_multiple_modes():
    f = StringIO()
    iterable('123', writer(f, 'writelines'))
    f.seek(0)
    result = f.read()
    print result
    assert result == '123'
예제 #3
0
def test_iterable_with_string():
    li = list()
    iterable(u'abc', collection(li))
    for letter in 'abc':
        assert letter in li
예제 #4
0
파일: test_sinks.py 프로젝트: timClicks/cop
def test_blackhole():
    iterable('anything', blackhole())
예제 #5
0
파일: test_sinks.py 프로젝트: timClicks/cop
def test_collection_with_sets():
    s = set()
    iterable('abc', collection(s))
    for letter in 'abc':
        assert letter in s
예제 #6
0
파일: test_sinks.py 프로젝트: timClicks/cop
def test_collection_with_lists():
    c = list()
    iterable('abc', collection(c))
    assert c == ['a', 'b', 'c']
예제 #7
0
파일: test_sinks.py 프로젝트: timClicks/cop
def test_writer_on_filelike():
    f = StringIO()
    iterable('123', writer(f, 'write'))
    f.seek(0)
    result = f.read()
    assert result == '123'
예제 #8
0
파일: test_sinks.py 프로젝트: timClicks/cop
def test_writer_on_std_file_descriptors():
    iterable('123', writer(sys.stdout))
예제 #9
0
파일: test_sinks.py 프로젝트: timClicks/cop
def test_printer():
    iterable('123', printer())
예제 #10
0
def test_iterable_with_string():
    li = list()
    iterable(u'abc', collection(li))
    for letter in 'abc':
    	assert letter in li
예제 #11
0
파일: test_sinks.py 프로젝트: timClicks/cop
def test_blackhole():
    iterable('anything', blackhole())
예제 #12
0
파일: test_sinks.py 프로젝트: timClicks/cop
def test_collection_with_sets():
    s = set()
    iterable('abc', collection(s))
    for letter in 'abc':
        assert letter in s
예제 #13
0
파일: test_sinks.py 프로젝트: timClicks/cop
def test_collection_with_lists():
    c = list()
    iterable('abc', collection(c))
    assert c == ['a', 'b', 'c'] 
예제 #14
0
파일: test_sinks.py 프로젝트: timClicks/cop
def test_writer_on_filelike():
    f = StringIO()
    iterable('123', writer(f, 'write'))
    f.seek(0)
    result = f.read()
    assert result == '123'
예제 #15
0
파일: test_sinks.py 프로젝트: timClicks/cop
def test_writer_on_std_file_descriptors():
    iterable('123', writer(sys.stdout))
예제 #16
0
파일: test_sinks.py 프로젝트: timClicks/cop
def test_printer():
    iterable('123', printer())