# Path: viper/openvpn/launcher.py
# class VPNLauncherException(Exception):
# class OpenVPNNotFoundException(VPNLauncherException):
# class OpenVPNLauncher:
#     def __init__(self):
#     def launch(self, cfgfile, logfile):
#     def terminate(self):


import sys, os
import psutil
    import unittest2 as unittest
    import unittest
from viper.openvpn import launcher
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
# 
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#


try:
except ImportError:

class LauncherTest(unittest.TestCase):
    def setUp(self):
        self.cfgfile = os.path.join(os.path.split(__file__)[0], "badconfig.ovpn")
        print self.cfgfile

    def tearDown(self):
    	pass

    def test_bad_config(self):
    	ovpn = launcher.OpenVPNLauncher()
        try:
            ovpn.launch(self.cfgfile)
            self.fail("OpenVPN was launched with  a bad config file and no exception has been thrown")

# Path: viper/openvpn/launcher.py
# class VPNLauncherException(Exception):
# class OpenVPNNotFoundException(VPNLauncherException):
# class OpenVPNLauncher:
#     def __init__(self):
#     def launch(self, cfgfile, logfile):
#     def terminate(self):


# Path: viper/openvpn/test/test_launcher.py
import sys, os
import psutil
    import unittest2 as unittest
    import unittest
from viper.openvpn import launcher

# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
# 
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#


try:
except ImportError:

class LauncherTest(unittest.TestCase):
    def setUp(self):
        self.cfgfile = os.path.join(os.path.split(__file__)[0], "badconfig.ovpn")
        print self.cfgfile

    def tearDown(self):
    	pass

    def test_bad_config(self):
    	ovpn = launcher.OpenVPNLauncher()
        try:
            ovpn.launch(self.cfgfile)
            self.fail("OpenVPN was launched with  a bad config file and no exception has been thrown")

        except launcher.VPNLauncherException, e: