1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-28 11:42:03 +03:00

Add tests for new NDR pack/unpack functionality in Python DCE/RPC bindings.

(This used to be commit 468d35827f)
This commit is contained in:
Jelmer Vernooij
2008-05-24 19:50:09 +02:00
parent e3bbe61d81
commit 05194ccdf8
3 changed files with 14 additions and 1 deletions

View File

@ -1,4 +1,5 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Unix SMB/CIFS implementation.
# Copyright © Jelmer Vernooij <jelmer@samba.org> 2008

View File

@ -18,6 +18,7 @@
#
from samba.dcerpc import echo
from samba.ndr import ndr_pack, ndr_unpack
import unittest
from samba.tests import RpcInterfaceTestCase
@ -40,3 +41,14 @@ class RpcEchoTests(RpcInterfaceTestCase):
surrounding_struct.surrounding = [1,2,3,4]
y = self.conn.TestSurrounding(surrounding_struct)
self.assertEquals(8 * [0], y.surrounding)
class NdrEchoTests(unittest.TestCase):
def test_info1_push(self):
x = echo.info1()
x.v = 42
self.assertEquals("\x2a", ndr_pack(x))
def test_info1_pull(self):
x = ndr_unpack(echo.info1, "\x42")
self.assertEquals(x.v, 66)