Add read,pread,write,pwrite support to the V2 protocol.
[Samba/nascimento.git] / source4 / param / tests / bindings.py
blob1915e79223a637aafaaf392008505922ddd5f109
1 #!/usr/bin/python
3 # Unix SMB/CIFS implementation.
4 # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 from samba import param
21 import unittest
23 class LoadParmTestCase(unittest.TestCase):
24 def test_init(self):
25 file = param.LoadParm()
26 self.assertTrue(file is not None)
28 def test_length(self):
29 file = param.LoadParm()
30 self.assertEquals(0, len(file))
32 def test_set_workgroup(self):
33 file = param.LoadParm()
34 file.set("workgroup", "bla")
35 self.assertEquals("BLA", file.get("workgroup"))
37 def test_is_mydomain(self):
38 file = param.LoadParm()
39 file.set("workgroup", "bla")
40 self.assertTrue(file.is_mydomain("BLA"))
41 self.assertFalse(file.is_mydomain("FOOBAR"))
43 def test_is_myname(self):
44 file = param.LoadParm()
45 file.set("netbios name", "bla")
46 self.assertTrue(file.is_myname("BLA"))
47 self.assertFalse(file.is_myname("FOOBAR"))
49 def test_load_default(self):
50 file = param.LoadParm()
51 file.load_default()
53 def test_section_nonexistant(self):
54 samba_lp = param.LoadParm()
55 samba_lp.load_default()
56 self.assertRaises(KeyError, samba_lp.__getitem__, "nonexistant")