# Path: cinje/util.py
# def flatten(input, file=None, encoding=None, errors='strict'):
# 	"""Return a flattened representation of a cinje chunk stream.
# 	
# 	This has several modes of operation.  If no `file` argument is given, output will be returned as a string.
# 	The type of string will be determined by the presence of an `encoding`; if one is given the returned value is a
# 	binary string, otherwise the native unicode representation.  If a `file` is present, chunks will be written
# 	iteratively through repeated calls to `file.write()`, and the amount of data (characters or bytes) written
# 	returned.  The type of string written will be determined by `encoding`, just as the return value is when not
# 	writing to a file-like object.  The `errors` argument is passed through when encoding.
# 	
# 	We can highly recommend using the various stremaing IO containers available in the
# 	[`io`](https://docs.python.org/3/library/io.html) module, though
# 	[`tempfile`](https://docs.python.org/3/library/tempfile.html) classes are also quite useful.
# 	"""
# 	
# 	input = stream(input, encoding, errors)
# 	
# 	if file is None:  # Exit early if we're not writing to a file.
# 		return b''.join(input) if encoding else ''.join(input)
# 	
# 	counter = 0
# 	
# 	for chunk in input:
# 		file.write(chunk)
# 		counter += len(chunk)
# 	
# 	return counter


import pytest
from cinje.util import flatten
	from cinje.std import html as std
# encoding: utf-8




@pytest.fixture
def std():
	return std


class TestStandardHTMLFive(object):
	def test_div(self, std):

# Path: cinje/util.py
# def flatten(input, file=None, encoding=None, errors='strict'):
# 	"""Return a flattened representation of a cinje chunk stream.
# 	
# 	This has several modes of operation.  If no `file` argument is given, output will be returned as a string.
# 	The type of string will be determined by the presence of an `encoding`; if one is given the returned value is a
# 	binary string, otherwise the native unicode representation.  If a `file` is present, chunks will be written
# 	iteratively through repeated calls to `file.write()`, and the amount of data (characters or bytes) written
# 	returned.  The type of string written will be determined by `encoding`, just as the return value is when not
# 	writing to a file-like object.  The `errors` argument is passed through when encoding.
# 	
# 	We can highly recommend using the various stremaing IO containers available in the
# 	[`io`](https://docs.python.org/3/library/io.html) module, though
# 	[`tempfile`](https://docs.python.org/3/library/tempfile.html) classes are also quite useful.
# 	"""
# 	
# 	input = stream(input, encoding, errors)
# 	
# 	if file is None:  # Exit early if we're not writing to a file.
# 		return b''.join(input) if encoding else ''.join(input)
# 	
# 	counter = 0
# 	
# 	for chunk in input:
# 		file.write(chunk)
# 		counter += len(chunk)
# 	
# 	return counter


# Path: test/test_std.py
import pytest
from cinje.util import flatten
	from cinje.std import html as std

# encoding: utf-8




@pytest.fixture
def std():
	return std


class TestStandardHTMLFive(object):
	def test_div(self, std):

		assert flatten(std.div(foo="bar", data_baz="42")) == '<div data-baz="42" foo="bar">\n</div>\n'