Commit 97a7be5d authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[2835] Test the uniqueness of names is enforced

Which isn't at the moment, so it fails.
parent f37600d5
......@@ -153,6 +153,82 @@ class DatasrcTest(unittest.TestCase):
}
}]})
def test_names_present(self):
"""
Test we don't choke on configuration with the "name" being present on
some items.
"""
self.accept({"IN": [{
"type": "MasterFiles",
"cache-enable": True,
"params": {},
"name": "Whatever"
}]})
def test_names_default_classes(self):
"""
Test we can have a client of the same type in different classes
without specified name. The defaults should be derived both from
the type and the class.
"""
self.accept({
"IN": [{
"type": "MasterFiles",
"cache-enable": True,
"params": {}
}],
"CH": [{
"type": "MasterFiles",
"cache-enable": True,
"params": {}
}]})
def test_names_collision(self):
"""
Reject when two names are the same.
Cases are:
- Explicit names.
- Two default names turn out to be the same (same type and class).
- One explicit is set to the same as the default one.
"""
self.reject({"IN": [
{
"type": "MasterFiles",
"cache-enable": True,
"params": {},
"name": "Whatever"
},
{
"type": "MasterFiles",
"cache-enable": True,
"params": {},
"name": "Whatever"
}]})
self.reject({"IN": [
{
"type": "MasterFiles",
"cache-enable": True,
"params": {}
},
{
"type": "MasterFiles",
"cache-enable": True,
"params": {}
}]})
self.reject({"IN": [
{
"type": "MasterFiles",
"cache-enable": True,
"params": {},
"name": "IN/MasterFiles"
},
{
"type": "MasterFiles",
"cache-enable": True,
"params": {}
}]})
if __name__ == '__main__':
isc.log.init("bind10")
isc.log.resetUnitTestRootLogger()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment