|
|
|
@ -121,12 +121,12 @@ class TestManager(TestCase): |
|
|
|
environ['YAML_TMP_DIR'] = tmpdir.dirname |
|
|
|
tc = Manager(get_config_filename('simple.yaml')) \ |
|
|
|
.sync(dry_run=False) |
|
|
|
self.assertEquals(25, tc) |
|
|
|
self.assertEquals(26, tc) |
|
|
|
|
|
|
|
# try with just one of the zones |
|
|
|
tc = Manager(get_config_filename('simple.yaml')) \ |
|
|
|
.sync(dry_run=False, eligible_zones=['unit.tests.']) |
|
|
|
self.assertEquals(19, tc) |
|
|
|
self.assertEquals(20, tc) |
|
|
|
|
|
|
|
# the subzone, with 2 targets |
|
|
|
tc = Manager(get_config_filename('simple.yaml')) \ |
|
|
|
@ -141,18 +141,18 @@ class TestManager(TestCase): |
|
|
|
# Again with force |
|
|
|
tc = Manager(get_config_filename('simple.yaml')) \ |
|
|
|
.sync(dry_run=False, force=True) |
|
|
|
self.assertEquals(25, tc) |
|
|
|
self.assertEquals(26, tc) |
|
|
|
|
|
|
|
# Again with max_workers = 1 |
|
|
|
tc = Manager(get_config_filename('simple.yaml'), max_workers=1) \ |
|
|
|
.sync(dry_run=False, force=True) |
|
|
|
self.assertEquals(25, tc) |
|
|
|
self.assertEquals(26, tc) |
|
|
|
|
|
|
|
# Include meta |
|
|
|
tc = Manager(get_config_filename('simple.yaml'), max_workers=1, |
|
|
|
include_meta=True) \ |
|
|
|
.sync(dry_run=False, force=True) |
|
|
|
self.assertEquals(29, tc) |
|
|
|
self.assertEquals(30, tc) |
|
|
|
|
|
|
|
def test_eligible_sources(self): |
|
|
|
with TemporaryDirectory() as tmpdir: |
|
|
|
@ -218,13 +218,13 @@ class TestManager(TestCase): |
|
|
|
fh.write('---\n{}') |
|
|
|
|
|
|
|
changes = manager.compare(['in'], ['dump'], 'unit.tests.') |
|
|
|
self.assertEquals(19, len(changes)) |
|
|
|
self.assertEquals(20, len(changes)) |
|
|
|
|
|
|
|
# Compound sources with varying support |
|
|
|
changes = manager.compare(['in', 'nosshfp'], |
|
|
|
['dump'], |
|
|
|
'unit.tests.') |
|
|
|
self.assertEquals(18, len(changes)) |
|
|
|
self.assertEquals(19, len(changes)) |
|
|
|
|
|
|
|
with self.assertRaises(ManagerException) as ctx: |
|
|
|
manager.compare(['nope'], ['dump'], 'unit.tests.') |
|
|
|
|