Ejemplo n.º 1
0
class RepositoryHandlerTestCase(unittest.TestCase):
    def setUp(self):
        pass

    @patch(
        'core.repository_handler.RepositoryHandler.load_repo_list_from_file',
        return_value={
            "11111": {
                "ssh_url": "[email protected]:prezi/repo1.git",
                "name": "test_repo",
                "language": "Python"
            }
        })
    @patch(
        'core.repository_handler.RepositoryHandler.load_repo_status_from_file',
        return_value={
            "11111": {
                "last_checked_hashes": ["aaaa"],
                "name": "test_repo"
            }
        })
    @patch('core.repository_handler.Repository')
    def test_create_repo_list_and_status_from_files(self, *mocks):
        logger = Mock()
        self.repository_handler = RepositoryHandler("test_work_dir",
                                                    logger=logger)
        self.repository_handler.create_repo_list_and_status_from_files()
        mocks[0].assert_called_with(
            '11111', {
                'name': 'test_repo',
                'language': 'Python',
                'ssh_url': '[email protected]:prezi/repo1.git'
            }, 'test_work_dir', logger)
        pass
Ejemplo n.º 2
0
 def test_create_repo_list_and_status_from_files(self, *mocks):
     logger = Mock()
     self.repository_handler = RepositoryHandler("test_work_dir",
                                                 logger=logger)
     self.repository_handler.create_repo_list_and_status_from_files()
     mocks[0].assert_called_with(
         '11111', {
             'name': 'test_repo',
             'language': 'Python',
             'ssh_url': '[email protected]:prezi/repo1.git'
         }, 'test_work_dir', logger)
     pass
Ejemplo n.º 3
0
class RepositoryHandlerTestCase(unittest.TestCase):
    def setUp(self):
        pass

    @patch('core.repository_handler.RepositoryHandler.load_repo_list_from_file',
           return_value={"11111": {"ssh_url": "[email protected]:prezi/repo1.git", "name":
                                   "test_repo", "language": "Python"}})
    @patch('core.repository_handler.RepositoryHandler.load_repo_status_from_file',
           return_value={"11111": {"last_checked_hashes": ["aaaa"], "name": "test_repo"}})
    @patch('core.repository_handler.Repository')
    def test_create_repo_list_and_status_from_files(self, *mocks):
        self.repository_handler = RepositoryHandler("test_work_dir")
        self.repository_handler.create_repo_list_and_status_from_files()
        mocks[0].assert_called_with('11111', {'name': 'test_repo', 'language': 'Python',
                                              'ssh_url': '[email protected]:prezi/repo1.git'}, 'test_work_dir')
        pass
Ejemplo n.º 4
0
 def test_create_repo_list_and_status_from_files(self, *mocks):
     logger = Mock()
     self.repository_handler = RepositoryHandler("test_work_dir", logger=logger)
     self.repository_handler.create_repo_list_and_status_from_files()
     mocks[0].assert_called_with('11111', {'name': 'test_repo', 'language': 'Python',
                                           'ssh_url': '[email protected]:prezi/repo1.git'}, 'test_work_dir', logger)
     pass