ldb_map: Fix CID 1034791 Dereference null return value
[Samba.git] / selftest / tests / test_socket_wrapper.py
blob81fe5b603cf8b4a0e68622b112d66b7706336565
1 # test_socket_wraper.py -- The tests for selftest socket wrapper routines
2 # Copyright (C) 2012 Jelmer Vernooij <jelmer@samba.org>
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.
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.
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.
20 """Tests for selftest/socket_wrapper."""
22 from selftest.tests import TestCase
24 from selftest import socket_wrapper
26 import os
28 class SocketWrapperTests(TestCase):
30 def test_setup_pcap(self):
31 socket_wrapper.setup_pcap("somefile")
32 self.assertEquals("somefile", os.environ["SOCKET_WRAPPER_PCAP_FILE"])
34 def test_set_default_iface(self):
35 socket_wrapper.set_default_iface(4)
36 self.assertEquals("4", os.environ["SOCKET_WRAPPER_DEFAULT_IFACE"])