# Path: mozz/test.py
# def run_test_module(name, file):
# 	outputfile = mozz.util.python_path_basename(file) + '.out'
# 
# 	m = sys.modules[name]
# 	ldr = unittest.loader.defaultTestLoader
# 	tests = ldr.loadTestsFromModule(m)
# 
# 	with open(outputfile, 'w') as f:
# 		duper = mozz.util.IOWriteDuplicator(
# 			sys.stderr, f
# 		)
# 		unittest.runner.TextTestRunner(
# 			verbosity = 2,
# 			stream = duper
# 		).run(tests)
# 
# Path: mozz/rand.py
# def intrange(a, b):
# def choice():
# def intrange_gen(a, b):
# def n_intranges(n, a, b):
# def byte():
# def bytes():
# def n_bytes(n):
# def byte_buf(amt):
# def intrange_buf(amt, a, b):
# def printable():
# def printable_char():
# def alpha_lower():
# def alpha_upper():


import unittest
import mozz
from mozz.test import run_test_module
from mozz import rand


class Test(unittest.TestCase):
	
	def test_intrange_gen(self):
		i = 0
		for rint in rand.intrange_gen(0, 56):
			self.assertTrue(isinstance(rint, int))
			i += 1
			if i > 99998:
				break

		self.assertEqual(i, 99999)

	def test_each_intrange(self):
		i = 0
		for rint in rand.n_intranges(20, 0, 987):
			self.assertTrue(isinstance(rint, int))
			i += 1
			if i > 25:
				break

		self.assertEqual(i, 20)

	def test_byte(self):

# Path: mozz/test.py
# def run_test_module(name, file):
# 	outputfile = mozz.util.python_path_basename(file) + '.out'
# 
# 	m = sys.modules[name]
# 	ldr = unittest.loader.defaultTestLoader
# 	tests = ldr.loadTestsFromModule(m)
# 
# 	with open(outputfile, 'w') as f:
# 		duper = mozz.util.IOWriteDuplicator(
# 			sys.stderr, f
# 		)
# 		unittest.runner.TextTestRunner(
# 			verbosity = 2,
# 			stream = duper
# 		).run(tests)
# 
# Path: mozz/rand.py
# def intrange(a, b):
# def choice():
# def intrange_gen(a, b):
# def n_intranges(n, a, b):
# def byte():
# def bytes():
# def n_bytes(n):
# def byte_buf(amt):
# def intrange_buf(amt, a, b):
# def printable():
# def printable_char():
# def alpha_lower():
# def alpha_upper():


# Path: test/mozz.rand_test.py
import unittest
import mozz
from mozz.test import run_test_module
from mozz import rand



class Test(unittest.TestCase):
	
	def test_intrange_gen(self):
		i = 0
		for rint in rand.intrange_gen(0, 56):
			self.assertTrue(isinstance(rint, int))
			i += 1
			if i > 99998:
				break

		self.assertEqual(i, 99999)

	def test_each_intrange(self):
		i = 0
		for rint in rand.n_intranges(20, 0, 987):
			self.assertTrue(isinstance(rint, int))
			i += 1
			if i > 25:
				break

		self.assertEqual(i, 20)

	def test_byte(self):

		self.assertTrue(isinstance(rand.byte(), int))