Exemplo n.º 1
0
    def test_param_show(self):
        '''
        Test to show params of varnish cache
        '''
        with patch.object(varnish, '_run_varnishadm',
                          return_value={'retcode': True,
                                        'stdout': 'A\nB\nC'}):
            self.assertFalse(varnish.param_show('param'))

        with patch.object(varnish, '_run_varnishadm',
                          return_value={'retcode': False,
                                        'stdout': 'A .1\nB .2\n'}):
            self.assertEqual(varnish.param_show('param'), {'A': '.1'})
Exemplo n.º 2
0
    def test_param_show(self):
        """
        Test to show params of varnish cache
        """
        with patch.object(
            varnish,
            "_run_varnishadm",
            return_value={"retcode": True, "stdout": "A\nB\nC"},
        ):
            self.assertFalse(varnish.param_show("param"))

        with patch.object(
            varnish,
            "_run_varnishadm",
            return_value={"retcode": False, "stdout": "A .1\nB .2\n"},
        ):
            self.assertEqual(varnish.param_show("param"), {"A": ".1"})