"""Builds a test suite for all tests in the 'core' directory.

The django-admin command `tests` looks for a tests.py file and expects a suite()
routine to return a unittest.TestSuite.
"""
import unittest

import KegbotJsonServer_unittest
import kegbot_unittest
import models_unittest
import StateMachine_unittest
import units_unittest
import util_unittest

from pykeg.core.Devices import Net_unittest

ALL_TEST_MODULES = (
    models_unittest,
    StateMachine_unittest,
    units_unittest,
    util_unittest,
    Net_unittest,
    KegbotJsonServer_unittest,
    kegbot_unittest,
)

def suite():
  suite = unittest.TestSuite()
  for module in ALL_TEST_MODULES:
    suite.addTests(unittest.TestLoader().loadTestsFromModule(module))
  return suite

# Copyright 2009 Mike Wakerly <opensource@hoho.com>
#
# This file is part of the Pykeg package of the Kegbot project.
# For more information on Pykeg or Kegbot, see http://kegbot.org/
#
# Pykeg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Pykeg is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Pykeg.  If not, see <http://www.gnu.org/licenses/>.

"""Builds a test suite for all tests in the 'core' directory.

The django-admin command `tests` looks for a tests.py file and expects a suite()
routine to return a unittest.TestSuite.
"""

import unittest

from pykeg.core import alarm_unittest
from pykeg.core import kegbot_unittest
from pykeg.core import models_unittest
from pykeg.core import StateMachine_unittest
from pykeg.core import units_unittest
from pykeg.core import util_unittest
from pykeg.core.net import kegnet_unittest

ALL_TEST_MODULES = (
    alarm_unittest,
    models_unittest,
    StateMachine_unittest,
    units_unittest,
    util_unittest,
    kegnet_unittest,
    kegbot_unittest,
)

def suite():
  suite = unittest.TestSuite()
  for module in ALL_TEST_MODULES:
    suite.addTests(unittest.TestLoader().loadTestsFromModule(module))
  return suite

Update unittest suite for new modules.