Example #1
0
 def test_get_repo_url(self, mock_subproc_popen):
     process_mock = mock.Mock()
     attrs = {'communicate.return_value': (
         "projectRequirements.txt", '')}
     process_mock.configure_mock(**attrs)
     mock_subproc_popen.return_value = process_mock
     x = get_repo_url("projectRequirements.txt")
     self.assertTrue(x)
     self.assertTrue(mock_subproc_popen.called)
Example #2
0
 def test_get_repo_url(self, mock_subproc_popen):
     """
     func to test the repo url
     :param mock_subproc_popen:
     :return: valid if the file exist in the repo
     """
     process_mock = mock.Mock()
     attrs = {'communicate.return_value': (
         "projectRequirements.txt", '')}
     process_mock.configure_mock(**attrs)
     mock_subproc_popen.return_value = process_mock
     value = get_repo_url("projectRequirements.txt")
     self.assertTrue(value)
     self.assertTrue(mock_subproc_popen.called)