s3:ntlm_auth: make logs more consistent with length check
[Samba.git] / python / samba / tests / s3windb.py
blob62f429cd126a6e1356b07f4af2e9a59808040fc5
1 # Unix SMB/CIFS implementation.
2 # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 """Tests for samba.samba3."""
20 from samba.samba3 import WinsDatabase
21 from samba.tests import TestCase
22 import os
25 for p in ["../../../../../testdata/samba3", "../../../../testdata/samba3"]:
26 DATADIR = os.path.join(os.path.dirname(__file__), p)
27 if os.path.exists(DATADIR):
28 break
31 class WinsDatabaseTestCase(TestCase):
33 def setUp(self):
34 super().setUp()
35 self.winsdb = WinsDatabase(os.path.join(DATADIR, "wins.dat"))
37 def test_length(self):
38 self.assertEqual(22, len(self.winsdb))
40 def test_first_entry(self):
41 self.assertEqual((1124185120, ["192.168.1.5"], 0x64), self.winsdb["ADMINISTRATOR#03"])
43 def tearDown(self):
44 self.winsdb.close()
45 super().tearDown()