Пример #1
0
    def test_get_repository(self):
        mocked_repository = MagicMock()
        mocked_repository.get_by_name.return_value = "my_repo"

        RepositoryManager.__bases__ = (MockManager,)
        with patch.multiple("pyolite.managers.repository", Repository=mocked_repository):

            repos = RepositoryManager("/path/to/admin/repo/")

            eq_(repos.get("my_repo"), "my_repo")
            mocked_repository.get_by_name.assert_called_once_with("my_repo", mocked_path, mocked_git)
Пример #2
0
def test_get_repository():
    mocked_repository = MagicMock()
    mocked_repository.get_by_name.return_value = 'my_repo'

    RepositoryManager.__bases__ = (MockManager, )
    with patch.multiple('pyolite.managers.repository',
                        Repository=mocked_repository):
        repos = RepositoryManager('/path/to/admin/repo/')

        assert repos.get('my_repo') == 'my_repo'
        mocked_repository.get_by_name.assert_called_once_with(
            'my_repo', mocked_path, mocked_git)
Пример #3
0
def test_get_repository():
    mocked_repository = MagicMock()
    mocked_repository.get_by_name.return_value = 'my_repo'

    RepositoryManager.__bases__ = (MockManager,)
    with patch.multiple('pyolite.managers.repository',
                        Repository=mocked_repository):
        repos = RepositoryManager('/path/to/admin/repo/')

        assert repos.get('my_repo') == 'my_repo'
        mocked_repository.get_by_name.assert_called_once_with('my_repo',
                                                              mocked_path,
                                                              mocked_git)