5862f1edf8a910fb58623c48805084446d166007
[obnox/samba/samba-obnox.git] / selftest / tests / test_socket_wrapper.py
1 # test_socket_wraper.py -- The tests for selftest socket wrapper routines
2 # Copyright (C) 2012 Jelmer Vernooij <jelmer@samba.org>
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; version 3
7 # of the License or (at your option) any later version of
8 # the License.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 # MA  02110-1301, USA.
19
20 """Tests for selftest/socket_wrapper."""
21
22 from unittest import TestCase
23
24 from selftest import socket_wrapper
25
26 import os
27
28 class SocketWrapperTests(TestCase):
29
30     def test_setup_pcap(self):
31         socket_wrapper.setup_pcap("somefile")
32         self.assertEquals("somefile", os.environ["SOCKET_WRAPPER_PCAP_FILE"])
33
34     def test_set_default_iface(self):
35         socket_wrapper.set_default_iface(4)
36         self.assertEquals("4", os.environ["SOCKET_WRAPPER_DEFAULT_IFACE"])