From 75c7fd4030a7c2ec5eeb752ccbc0f5fde74d1029 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 21 Nov 2007 12:31:26 +0100 Subject: r26073: Import Python bindings for the registry. (This used to be commit 777205b5705940c00384172c531ea99ba3eae235) --- source4/lib/registry/tests/bindings.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 source4/lib/registry/tests/bindings.py (limited to 'source4/lib/registry/tests/bindings.py') diff --git a/source4/lib/registry/tests/bindings.py b/source4/lib/registry/tests/bindings.py new file mode 100644 index 0000000000..be87efe594 --- /dev/null +++ b/source4/lib/registry/tests/bindings.py @@ -0,0 +1,34 @@ +#!/usr/bin/python + +# Unix SMB/CIFS implementation. +# Copyright (C) Jelmer Vernooij 2007 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +import unittest +import registry + +class HelperTests(unittest.TestCase): + def test_predef_to_name(self): + self.assertEquals("HKEY_LOCAL_MACHINE", + registry.reg_get_predef_name(0x80000002)) + + def test_str_regtype(self): + self.assertEquals("REG_DWORD", registry.str_regtype(4)) + + +class RegistryTests(unittest.TestCase): + def test_new(self): + self.registry = registry.Registry() -- cgit From 249cc734cebfef31320ec10b05dbfaaaa39682ca Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 22 Dec 2007 05:03:02 -0600 Subject: r26565: Fix python registry bindings. 'PROVISION_PYTHON=yes make test' works now. (This used to be commit 485d1fa3d17fe6cc7a0ecd80e8bac42d173bbb19) --- source4/lib/registry/tests/bindings.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source4/lib/registry/tests/bindings.py') diff --git a/source4/lib/registry/tests/bindings.py b/source4/lib/registry/tests/bindings.py index be87efe594..9f93ee9382 100644 --- a/source4/lib/registry/tests/bindings.py +++ b/source4/lib/registry/tests/bindings.py @@ -17,8 +17,10 @@ # along with this program. If not, see . # +import os import unittest import registry +import samba.tests class HelperTests(unittest.TestCase): def test_predef_to_name(self): @@ -29,6 +31,22 @@ class HelperTests(unittest.TestCase): self.assertEquals("REG_DWORD", registry.str_regtype(4)) + +class HiveTests(samba.tests.TestCaseInTempDir): + def setUp(self): + super(HiveTests, self).setUp() + self.hive = registry.open_ldb(os.path.join(self.tempdir, "ldb_new.ldb")) + + def test_ldb_new(self): + self.assertTrue(self.hive is not None) + + def test_flush(self): + self.hive.flush() + + def test_del_value(self): + self.hive.del_value("FOO") + + class RegistryTests(unittest.TestCase): def test_new(self): self.registry = registry.Registry() -- cgit From aa0a06f13c44e0eca0b3f2f0c34f0f7995b87159 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 23 Dec 2007 19:19:41 -0600 Subject: r26570: - Trim size of the swig-generated Python bindings by removing a bunch of {}'s. - Start working on Python equivalents for various EJS tests. - Fix regression in argument order for reg_diff_apply() in EJS bindings. (This used to be commit c550c03372cb260b78f6a6c132e70571bc4cb852) --- source4/lib/registry/tests/bindings.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/lib/registry/tests/bindings.py') diff --git a/source4/lib/registry/tests/bindings.py b/source4/lib/registry/tests/bindings.py index 9f93ee9382..906deed7e9 100644 --- a/source4/lib/registry/tests/bindings.py +++ b/source4/lib/registry/tests/bindings.py @@ -40,11 +40,11 @@ class HiveTests(samba.tests.TestCaseInTempDir): def test_ldb_new(self): self.assertTrue(self.hive is not None) - def test_flush(self): - self.hive.flush() + #def test_flush(self): + # self.hive.flush() - def test_del_value(self): - self.hive.del_value("FOO") + #def test_del_value(self): + # self.hive.del_value("FOO") class RegistryTests(unittest.TestCase): -- cgit From 533cc583ed20efdfd6bee60f86d16fef3942898b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 25 Dec 2007 16:36:44 -0600 Subject: r26596: Fixed upgrade.py. Added blackbox tests for provision and upgrade Python scripts. Clean up temporary files created by the Python tests. (This used to be commit 2227fb6df62240cae64d27a1920d878316f819fc) --- source4/lib/registry/tests/bindings.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source4/lib/registry/tests/bindings.py') diff --git a/source4/lib/registry/tests/bindings.py b/source4/lib/registry/tests/bindings.py index 906deed7e9..314cf778a1 100644 --- a/source4/lib/registry/tests/bindings.py +++ b/source4/lib/registry/tests/bindings.py @@ -35,7 +35,12 @@ class HelperTests(unittest.TestCase): class HiveTests(samba.tests.TestCaseInTempDir): def setUp(self): super(HiveTests, self).setUp() - self.hive = registry.open_ldb(os.path.join(self.tempdir, "ldb_new.ldb")) + self.hive_path = os.path.join(self.tempdir, "ldb_new.ldb") + self.hive = registry.open_ldb(self.hive_path) + + def tearDown(self): + del self.hive + os.unlink(self.hive_path) def test_ldb_new(self): self.assertTrue(self.hive is not None) -- cgit From 49706ab19bd3ffd6125639e6a7753b2350cf54e1 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 21 May 2008 23:59:34 +0200 Subject: Move more modules inside of the samba package. (This used to be commit 9b39e99f48266a54ed0b8890c2efde218b4b118a) --- source4/lib/registry/tests/bindings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/lib/registry/tests/bindings.py') diff --git a/source4/lib/registry/tests/bindings.py b/source4/lib/registry/tests/bindings.py index 314cf778a1..1fb5c70b70 100644 --- a/source4/lib/registry/tests/bindings.py +++ b/source4/lib/registry/tests/bindings.py @@ -19,7 +19,7 @@ import os import unittest -import registry +from samba import registry import samba.tests class HelperTests(unittest.TestCase): -- cgit