diff options
author | Michael Fenn <fennm@deshawresearch.com> | 2013-08-06 16:01:12 -0400 |
---|---|---|
committer | Michael Fenn <fennm@deshawresearch.com> | 2013-08-06 16:01:12 -0400 |
commit | 4bf1c82868357e5c357e0b656419af37a99a8545 (patch) | |
tree | f6936718d151e65ac1b113cbdd692869218e8fdf /testsuite/Testsrc/Testlib/TestServer/TestPlugins | |
parent | 936b8aa2b6329ddf45c1032171c16d0eaea99b37 (diff) | |
download | bcfg2-4bf1c82868357e5c357e0b656419af37a99a8545.tar.gz bcfg2-4bf1c82868357e5c357e0b656419af37a99a8545.tar.bz2 bcfg2-4bf1c82868357e5c357e0b656419af37a99a8545.zip |
Get profile by building metadata instead of guessing
Rather than doing some ad-hoc lookups of internal data structures
stpierre suggested that it'd be better to use the normal metadata
build procedures. This implements that and adjusts the tests.
Diffstat (limited to 'testsuite/Testsrc/Testlib/TestServer/TestPlugins')
-rw-r--r-- | testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestMetadata.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestMetadata.py b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestMetadata.py index 1273f0d30..32c893548 100644 --- a/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestMetadata.py +++ b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestMetadata.py @@ -885,6 +885,9 @@ class TestMetadata(_TestMetadata, TestClientRunHooks, TestDatabaseBacked): metadata = self.load_clients_data(metadata=self.load_groups_data()) if not metadata._use_db: metadata.clients_xml.write = Mock() + metadata.core.build_metadata = Mock() + metadata.core.build_metadata.side_effect = \ + lambda c: metadata.get_initial_metadata(c) metadata.set_profile("client1", "group2", None) mock_update_client.assert_called_with("client1", |