Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(31)  |  Call(21)  |  Derive(0)  |  Import(10)

src/p/i/pida-0.6.2/tests/editors/conftest.py   pida(Download)
import py
from pida.utils.testing.mock import Mock
from pida.core.boss import Boss
from pida.core.events import EventsConfig
from pida.ui.window import PidaWindow
def mock_service(name):
    self = Mock()
    self.name = name
    self.events = Mock(spec=EventsConfig)
    return self
 
def mock_boss():
    self = Mock(spec=Boss)

src/p/i/pida-0.6.2/tests/ui/test_window.py   pida(Download)
 
from pida.utils.testing import refresh_gui
from pida.utils.testing.mock import Mock
from pida.ui.window import PidaWindow
from pida.core.boss import Boss
from pida.services.window.window import Window as WindowSvc
 
def pytest_funcarg__boss(request):
    boss = Mock(Boss)
    boss.window = Mock(PidaWindow)
    boss.window.get_size.return_value = (640, 480)
    boss.window.get_position.return_value = (0, 0)
    boss.window.paned = Mock()
    boss.get_services.return_value = [] #XXX: mock up something for later
    return boss
 
def pytest_funcarg__svc(request):
    return Mock(WindowSvc)

src/p/i/pida-0.6.2/pida/services/project/test_project.py   pida(Download)
from pida.core.projects import Project
from .project import ProjectService
from pida.utils.testing.mock import Mock
from pida.core.environment import library
library.add_global_resource('glade', 
                            os.path.join(os.path.dirname(__file__), 'glade'))
 
def test_loaded_event():
    boss = Mock()
    #XXX: mock mimicing the result of project_service.pre_start
    project_service._projects = []
    project_service.project_list = Mock()
    project_service.project_list.project_ol = Mock()
 
def test_startup_with_missing_project(tmpdir, monkeypatch):
    #XXX: log entries
    boss = Mock()
    boss.return_value = [str(tmpdir.join('missing-dir'))]
    svc = ProjectService(boss)

src/p/i/pida-0.6.2/pida/services/plugins/test_ui.py   pida(Download)
from . import plugins
 
import py
from pida.utils.testing.mock import Mock
 
#XXX: larger unittests for the downloader?!
 
def pytest_funcarg__boss(request):
    return Mock()
def test_plugins_view_enable_and_disable():
    svc = Mock()
    view = plugins.PluginsView(svc)
 
    foo = PP('foo', True)

src/p/i/pida-0.6.2/pida/services/optionsmanager/test_optionsmanager.py   pida(Download)
from .optionsmanager import PidaOptionsView
from pida.utils.testing.mock import Mock
 
def test_instanciate_options_view():
    svc = Mock()

src/p/i/pida-0.6.2/pida/services/filemanager/test_filemanager.py   pida(Download)
from pida.core.boss import Boss
from pida.utils.testing.mock import Mock
from pygtkhelpers.utils import refresh_gui
from .filemanager import FilemanagerView, Filemanager
 
    browse = tmpdir.ensure('browse', dir=1)
    browse.ensure('test.py')
    boss = Mock(Boss)
    boss.cmd.return_value = []
    svc = Filemanager(boss)

src/p/i/pida-0.6.2/pida/services/buffer/test_buffer.py   pida(Download)
from pida.services.buffer.buffer import Buffer
from pida.utils.testing.mock import Mock
 
def test_recover_loading_error():
    boss = Mock()
    svc = Buffer(boss)
    svc._documents = {}
 
    error = Mock()

src/p/i/pida-0.6.2/pida-plugins/waypoint/test_waypoint.py   pida(Download)
#SOFTWARE.
 
from pida.utils.testing.mock import Mock
 
from pida.core.document import Document
 
from .waypoint import WayPoint, WayStack
 
BOSS = Mock()
    def test_has(self):
        doc1 = Document(BOSS)
        doc2 = Document(BOSS)
        wp = WayStack(max_length=10, threshold=10)
        w1 = WayPoint(doc1, 10)
    def test_maxlength(self):
        doc1 = Document(BOSS)
        wp = WayStack(max_length=10, threshold=10, timespan=5)
        for i in xrange(20):
            wp.notify_change(doc1, 100*i+1, time_=(60*i)+1)

src/p/i/pida-0.6.2/pida-plugins/python_lint/test_pylint.py   pida(Download)
#SOFTWARE.
 
from pida.utils.testing.mock import Mock
from unittest import TestCase
 

src/p/i/pida-0.6.2/pida-plugins/ctags/test_ctags.py   pida(Download)
TESTDIR = os.path.join(os.path.dirname(__file__), 'test')
 
from pida.utils.testing.mock import Mock
 
class TestCtags(unittest.TestCase):