Beispiel #1
0
 def test_read_file(self):
     '''
     Test if the parsing function works
     '''
     with patch('salt.utils.files.fopen', mock_open(read_data=MOCK_FILE)):
         self.assertListEqual(pam.read_file('/etc/pam.d/login'),
                              [{'arguments': [], 'control_flag': 'ok',
                                'interface': 'ok', 'module': 'ignore'}])
Beispiel #2
0
 def test_read_file(self):
     '''
     Test if the parsing function works
     '''
     with patch('salt.utils.fopen', mock_open(read_data=MOCK_FILE)):
         self.assertListEqual(pam.read_file('/etc/pam.d/login'),
                              [{'arguments': [], 'control_flag': 'ok',
                                'interface': 'ok', 'module': 'ignore'}])
Beispiel #3
0
 def test_read_file(self):
     """
     Test if the parsing function works
     """
     with patch("os.path.exists",
                return_value=True), patch("salt.utils.files.fopen",
                                          mock_open(read_data=MOCK_FILE)):
         self.assertListEqual(
             pam.read_file("/etc/pam.d/login"),
             [{
                 "arguments": [],
                 "control_flag": "ok",
                 "interface": "ok",
                 "module": "ignore",
             }],
         )