Пример #1
0
class TestPHPTransformer(TransformerTestCase):
    def setup_method(self, method):
        self.t = PHPTransformer({})

    @pytest.mark.parametrize(('spec', 'expected'), [
        ('%{__php} blah blah\n', scl_enable + '%{__php} blah blah\n' + scl_disable),
        ('%{__ztsphp} blah blah\n', scl_enable + '%{__ztsphp} blah blah\n' + scl_disable),
        ('%{__pear} blah blah\n', scl_enable + '%{__pear} blah blah\n' + scl_disable),
        ('%{__pecl} blah blah\n', scl_enable + '%{__pecl} blah blah\n' + scl_disable),
    ])
    def test_php_specific_commands_matching(self, spec, expected):
        spec = self.make_prep(spec)
        handler = self.t.handle_php_specific_commands
        assert self.t.handle_php_specific_commands(spec, self.get_pattern_for_spec(handler, spec), spec) == self.make_prep(expected)
class TestPHPTransformer(TransformerTestCase):
    def setup_method(self, method):
        self.t = PHPTransformer({})

    @pytest.mark.parametrize(('spec', 'expected'), [
        ('%{__php} blah blah\n',
         scl_enable + '%{__php} blah blah\n' + scl_disable),
        ('%{__ztsphp} blah blah\n',
         scl_enable + '%{__ztsphp} blah blah\n' + scl_disable),
        ('%{__pear} blah blah\n',
         scl_enable + '%{__pear} blah blah\n' + scl_disable),
        ('%{__pecl} blah blah\n',
         scl_enable + '%{__pecl} blah blah\n' + scl_disable),
    ])
    def test_php_specific_commands_matching(self, spec, expected):
        spec = self.make_prep(spec)
        handler = self.t.handle_php_specific_commands
        assert self.t.handle_php_specific_commands(
            spec, self.get_pattern_for_spec(handler, spec),
            spec) == self.make_prep(expected)
 def setup_method(self, method):
     self.t = PHPTransformer({})
Пример #4
0
 def setup_method(self, method):
     self.t = PHPTransformer({})