# 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
			'sig_count': 0
		}

		@s.on_signal_default()
		def default_sig(host, sig):
			d['sig_count'] += 1
			self.assertEqual(sig, mozz.sig.SIGINT)

		mozz.run_session(s)
		self.assertEqual(d['sig_count'], 1)

	def test_sig_handler(self):
		s = mozz.Session(abs_path(__file__, "signal1_test.bin"))

		d = {
			'int_count': 0
		}
	
		@s.on_signal_default()
		def default_sig(host, sig):
			self.assertTrue(False) # shouldnt get here

		@s.on_signal(mozz.sig.SIGINT)
		def on_sigint(host):
			d['int_count'] += 1

		mozz.run_session(s)
		self.assertEqual(d['int_count'], 1)

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


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

			'sig_count': 0
		}

		@s.on_signal_default()
		def default_sig(host, sig):
			d['sig_count'] += 1
			self.assertEqual(sig, mozz.sig.SIGINT)

		mozz.run_session(s)
		self.assertEqual(d['sig_count'], 1)

	def test_sig_handler(self):
		s = mozz.Session(abs_path(__file__, "signal1_test.bin"))

		d = {
			'int_count': 0
		}
	
		@s.on_signal_default()
		def default_sig(host, sig):
			self.assertTrue(False) # shouldnt get here

		@s.on_signal(mozz.sig.SIGINT)
		def on_sigint(host):
			d['int_count'] += 1

		mozz.run_session(s)
		self.assertEqual(d['int_count'], 1)

	def test_start(self):

		s = mozz.Session(abs_path(__file__, "signal1_test.bin"))