示例#1
0
 def test_tag_should_be_expanded_from_database(self):
     tag_expander = VclTagExpander('ACL',
                                   'ACL',
                                   VclRendererInput(),
                                   can_overwrite=True)
     assert_equals('## ACL custom content ##',
                   tag_expander.expand(self.vcl_template3))
示例#2
0
    def test_tag_should_be_expanded_from_file_template(self):
        tag_expander = VclTagExpander('VCL', 'VCL', VclRendererInput())
        expected_v4 = '''\
# Marker to tell the VCL compiler that this VCL has been adapted to the
# new 4.0 format.
vcl 4.0;

import std;
import directors;

<HEADERS/>
<ACL/>
<DIRECTORS/>
<VAAS_STATUS/>
<RECV/>
<OTHER_FUNCTIONS/>
<EMPTY_DIRECTOR_SYNTH/>'''
        assert_equals(expected_v4, tag_expander.expand(self.vcl_template4))
示例#3
0
    def test_tag_should_be_expanded_from_file_template(self):
        tag_expander = VclTagExpander('VCL', 'VCL', VclRendererInput())
        expected_v3 = '<HEADERS/>\n<ACL/>\n<DIRECTORS/>\n<RECV/>\n<OTHER_FUNCTIONS/>'
        expected_v4 = '''\
# Marker to tell the VCL compiler that this VCL has been adapted to the
# new 4.0 format.
vcl 4.0;

import std;
import directors;

<HEADERS/>
<ACL/>
<DIRECTORS/>
<RECV/>
<OTHER_FUNCTIONS/>'''

        assert_equals(expected_v3, tag_expander.expand(self.vcl_template3))
        assert_equals(expected_v4, tag_expander.expand(self.vcl_template4))
示例#4
0
 def test_tag_should_be_expanded_from_database(self):
     tag_expander = VclTagExpander('ACL', 'ACL', VclRendererInput(), can_overwrite=True)
     assert_equals('## ACL custom content ##', tag_expander.expand(self.vcl_template3))