Beispiel #1
0
 def test_get_cf_files_none(self, mock_walk, mock_isfile):
     mock_queue = mock.Mock(spec=Queue)
     mock_walk.return_value = [
         (R_PATH, (), ())
     ]
     mock_isfile.return_value = True
     get_cf_files(R_PATH, mock_queue)
     mock_walk.assert_called_once_with(R_PATH)
Beispiel #2
0
 def test_get_cf_files(self, mock_walk, mock_isfile):
     mock_queue = mock.Mock(spec=Queue)
     mock_walk.return_value = [(R_PATH, (), CF_FILES)]
     mock_isfile.return_value = True
     expected_calls = [
         mock.call('%s/%s' % (R_PATH, filename)) for filename in CF_FILES
         if (filename.endswith('.cf') or filename.endswith('.post'))
     ]
     get_cf_files(R_PATH, mock_queue)
     mock_walk.assert_called_once_with(R_PATH)
     self.assertTrue(mock_queue.put.called)
     self.assertEqual(expected_calls, mock_queue.put.call_args_list)
Beispiel #3
0
 def test_get_cf_files(self, mock_walk, mock_isfile):
     mock_queue = mock.Mock(spec=Queue)
     mock_walk.return_value = [
         (R_PATH, (), CF_FILES)
     ]
     mock_isfile.return_value = True
     expected_calls = [
         mock.call('%s/%s' % (R_PATH, filename))
         for filename in CF_FILES
         if (filename.endswith('.cf') or filename.endswith('.post'))
     ]
     get_cf_files(R_PATH, mock_queue)
     mock_walk.assert_called_once_with(R_PATH)
     self.assertTrue(mock_queue.put.called)
     self.assertEqual(expected_calls, mock_queue.put.call_args_list)
Beispiel #4
0
 def test_get_cf_files_none(self, mock_walk, mock_isfile):
     mock_queue = mock.Mock(spec=Queue)
     mock_walk.return_value = [(R_PATH, (), ())]
     mock_isfile.return_value = True
     get_cf_files(R_PATH, mock_queue)
     mock_walk.assert_called_once_with(R_PATH)