# Path: conpot/protocols/modbus/modbus_server.py
# class ModbusServer(modbus.Server):
#     def __init__(self, template, template_directory, args):
#     def _get_mode_and_delay(self, template):
#     def _configure_slaves(self, template):
#     def handle(self, sock, address):
#     def start(self, host, port):
#     def stop(self):


from gevent import monkey
from datetime import datetime
from modbus_tk.exceptions import ModbusError
from gevent import socket
from conpot.protocols.modbus import modbus_server
from conpot.utils.greenlet import spawn_test_server, teardown_test_server
import unittest
import modbus_tk.defines as cst
import modbus_tk.modbus_tcp as modbus_tcp
import conpot.core as conpot_core
# Copyright (C) 2013  Johnny Vestergaard <jkv@unixcluster.dk>
#
# This program 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.
#
# This program 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 this program; if not, write to the Free Software
# Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.


monkey.patch_all()





class TestModbusServer(unittest.TestCase):
    def setUp(self):
        conpot_core.get_sessionManager().purge_sessions()

        self.modbus, self.greenlet = spawn_test_server(

# Path: conpot/protocols/modbus/modbus_server.py
# class ModbusServer(modbus.Server):
#     def __init__(self, template, template_directory, args):
#     def _get_mode_and_delay(self, template):
#     def _configure_slaves(self, template):
#     def handle(self, sock, address):
#     def start(self, host, port):
#     def stop(self):


# Path: conpot/tests/test_modbus_server.py
from gevent import monkey
from datetime import datetime
from modbus_tk.exceptions import ModbusError
from gevent import socket
from conpot.protocols.modbus import modbus_server
from conpot.utils.greenlet import spawn_test_server, teardown_test_server
import unittest
import modbus_tk.defines as cst
import modbus_tk.modbus_tcp as modbus_tcp
import conpot.core as conpot_core

# Copyright (C) 2013  Johnny Vestergaard <jkv@unixcluster.dk>
#
# This program 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.
#
# This program 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 this program; if not, write to the Free Software
# Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.


monkey.patch_all()





class TestModbusServer(unittest.TestCase):
    def setUp(self):
        conpot_core.get_sessionManager().purge_sessions()

        self.modbus, self.greenlet = spawn_test_server(

            modbus_server.ModbusServer, "default", "modbus"