mirror of
https://github.com/samba-team/samba.git
synced 2025-03-01 04:58:35 +03:00
selftest.socket_wrapper: Add basic unit tests.
This commit is contained in:
parent
adbd55ea55
commit
0cfb8e033c
@ -23,10 +23,8 @@ import unittest
|
||||
|
||||
def test_suite():
|
||||
result = unittest.TestSuite()
|
||||
names = ['socketwrapper']
|
||||
names = ['socket_wrapper']
|
||||
module_names = ['selftest.tests.test_' + name for name in names]
|
||||
loader = unittest.TestLoader()
|
||||
result.addTests(loader.loadTestsFromNames(module_names))
|
||||
from dulwich.tests.compat import test_suite as compat_test_suite
|
||||
result.addTests(compat_test_suite())
|
||||
return result
|
||||
|
@ -18,3 +18,18 @@
|
||||
# MA 02110-1301, USA.
|
||||
|
||||
"""Tests for selftest/socket_wrapper."""
|
||||
|
||||
from selftest import socket_wrapper
|
||||
|
||||
import os
|
||||
import unittest
|
||||
|
||||
class SocketWrapperTests(unittest.TestCase):
|
||||
|
||||
def test_setup_pcap(self):
|
||||
socket_wrapper.setup_pcap("somefile")
|
||||
self.assertEquals("somefile", os.environ["SOCKET_WRAPPER_PCAP_FILE"])
|
||||
|
||||
def test_set_default_iface(self):
|
||||
socket_wrapper.set_default_iface(4)
|
||||
self.assertEquals("4", os.environ["SOCKET_WRAPPER_DEFAULT_IFACE"])
|
||||
|
Loading…
x
Reference in New Issue
Block a user