# 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)
# 
# def abs_path(base_file, rel_path):
# 	return os.path.join(
# 		os.path.dirname(os.path.abspath(base_file)),
# 		rel_path
# 	)


import unittest
import mozz
import mozz.sig
from mozz.test import run_test_module, abs_path
		def entry(host):
			d['at_entry'] += 1
			s.del_cb_entry(entry)

		@s.on_signal(mozz.sig.SIGINT)
		def sigint(host):
			d['on_sigint'] += 1
			s.del_cb_signal(mozz.sig.SIGINT, sigint)
			@s.on_signal_default()
			def sig_default(host, sig):
				d['on_sig_default'] += 1
				s.del_cb_signal_default(sig_default)

		start1_first = [0]
		@s.on_start()
		def start(host):
			start1_first[0] += 1
			d['on_start'] += 1
			s.del_cb_start(start)

		@s.on_start()
		def start2(host):
			d['on_start2'] += 1
			self.assertEqual(start1_first[0], 1)
			if d['on_start2'] >= 3:
				s.del_cb_start(start2)

		@s.on_exit()
		def on_exit(host):
			d['on_exit'] += 1

# 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)
# 
# def abs_path(base_file, rel_path):
# 	return os.path.join(
# 		os.path.dirname(os.path.abspath(base_file)),
# 		rel_path
# 	)


# Path: test/cb_remove_test.py
import unittest
import mozz
import mozz.sig
from mozz.test import run_test_module, abs_path

		def entry(host):
			d['at_entry'] += 1
			s.del_cb_entry(entry)

		@s.on_signal(mozz.sig.SIGINT)
		def sigint(host):
			d['on_sigint'] += 1
			s.del_cb_signal(mozz.sig.SIGINT, sigint)
			@s.on_signal_default()
			def sig_default(host, sig):
				d['on_sig_default'] += 1
				s.del_cb_signal_default(sig_default)

		start1_first = [0]
		@s.on_start()
		def start(host):
			start1_first[0] += 1
			d['on_start'] += 1
			s.del_cb_start(start)

		@s.on_start()
		def start2(host):
			d['on_start2'] += 1
			self.assertEqual(start1_first[0], 1)
			if d['on_start2'] >= 3:
				s.del_cb_start(start2)

		@s.on_exit()
		def on_exit(host):
			d['on_exit'] += 1

			s.del_cb_exit(on_exit)