summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-admin/salt/files/salt-2015.8.0-remove-pydsl-includes-test.patch')
-rw-r--r--app-admin/salt/files/salt-2015.8.0-remove-pydsl-includes-test.patch107
1 files changed, 107 insertions, 0 deletions
diff --git a/app-admin/salt/files/salt-2015.8.0-remove-pydsl-includes-test.patch b/app-admin/salt/files/salt-2015.8.0-remove-pydsl-includes-test.patch
new file mode 100644
index 000000000000..469e0d27e101
--- /dev/null
+++ b/app-admin/salt/files/salt-2015.8.0-remove-pydsl-includes-test.patch
@@ -0,0 +1,107 @@
+diff --git a/tests/unit/pydsl_test.py b/tests/unit/pydsl_test.py
+index 2f39a41..2052f55 100644
+--- a/tests/unit/pydsl_test.py
++++ b/tests/unit/pydsl_test.py
+@@ -445,102 +445,6 @@ class PyDSLRendererTestCase(CommonTestCaseBoilerplate):
+ shutil.rmtree(dirpath, ignore_errors=True)
+
+
+-class PyDSLRendererIncludeTestCase(CommonTestCaseBoilerplate):
+-
+- def test_rendering_includes(self):
+- dirpath = tempfile.mkdtemp(dir=integration.SYS_TMP_DIR)
+- if not os.path.isdir(dirpath):
+- self.skipTest(
+- 'The temporary directory {0!r} was not created'.format(
+- dirpath
+- )
+- )
+- output = os.path.join(dirpath, 'output')
+- try:
+- write_to(os.path.join(dirpath, 'aaa.sls'), textwrap.dedent('''\
+- #!pydsl|stateconf -ps
+-
+- include('xxx')
+- yyy = include('yyy')
+-
+- # ensure states in xxx are run first, then those in yyy and then those in aaa last.
+- extend(state('yyy::start').stateconf.require(stateconf='xxx::goal'))
+- extend(state('.start').stateconf.require(stateconf='yyy::goal'))
+-
+- extend(state('yyy::Y2').cmd.run('echo Y2 extended >> {0}'))
+-
+- __pydsl__.set(ordered=True)
+-
+- yyy.hello('red', 1)
+- yyy.hello('green', 2)
+- yyy.hello('blue', 3)
+- '''.format(output)))
+-
+- write_to(os.path.join(dirpath, 'xxx.sls'), textwrap.dedent('''\
+- #!stateconf -os yaml . jinja
+-
+- include:
+- - yyy
+-
+- extend:
+- yyy::start:
+- stateconf.set:
+- - require:
+- - stateconf: .goal
+-
+- yyy::Y1:
+- cmd.run:
+- - name: 'echo Y1 extended >> {0}'
+-
+- .X1:
+- cmd.run:
+- - name: echo X1 >> {1}
+- - cwd: /
+- .X2:
+- cmd.run:
+- - name: echo X2 >> {2}
+- - cwd: /
+- .X3:
+- cmd.run:
+- - name: echo X3 >> {3}
+- - cwd: /
+-
+- '''.format(output, output, output, output)))
+-
+- write_to(os.path.join(dirpath, 'yyy.sls'), textwrap.dedent('''\
+- #!pydsl|stateconf -ps
+-
+- include('xxx')
+- __pydsl__.set(ordered=True)
+-
+- state('.Y1').cmd.run('echo Y1 >> {0}', cwd='/')
+- state('.Y2').cmd.run('echo Y2 >> {1}', cwd='/')
+- state('.Y3').cmd.run('echo Y3 >> {2}', cwd='/')
+-
+- def hello(color, number):
+- state(color).cmd.run('echo hello '+color+' '+str(number)+' >> {3}', cwd='/')
+- '''.format(output, output, output, output)))
+-
+- self.state_highstate({'base': ['aaa']}, dirpath)
+- expected = textwrap.dedent('''\
+- X1
+- X2
+- X3
+- Y1 extended
+- Y2 extended
+- Y3
+- hello red 1
+- hello green 2
+- hello blue 3
+- ''')
+-
+- with salt.utils.fopen(output, 'r') as f:
+- self.assertEqual(sorted(f.read()), sorted(expected))
+-
+- finally:
+- shutil.rmtree(dirpath, ignore_errors=True)
+-
+-
+ def write_to(fpath, content):
+ with salt.utils.fopen(fpath, 'w') as f:
+ f.write(content)