Example #1
0
"""

from utils import (
	int_to_base_array,
	split,
	hierarchicize
	)


# Test int_to_base_array()
for test in [
	(	(255,10),		[2,5,5]				),
	(	(256,10),		[2,5,6]				),
	(	(255,2),		[1,1,1,1,1,1,1,1]	),
	]:
	assert int_to_base_array(*test[0]) == test[1]


# Test split()
for test in [
	(	(1,1),			(1,0)		),
	(	(10,1),			(10,0)		),
	(	(0,1),			(0,0)		),
	(	(1.5,0.5),		(3,0)		),
	(	(1.5,1),		(1,0.5)		),
	(	(15,10),		(1,5)		),
	]:
	assert split(*test[0]) == test[1]

# Test hierarchicize()
for test in [