コード例 #1
0
def test_load_css():
    """
    The OS's file system explorer is opened in the correct location for the
    web application's CSS files.
    """
    editor = mock.MagicMock()
    view = mock.MagicMock()
    wm = WebMode(editor, view)
    view.current_tab.path = os.path.join(wm.workspace_dir(), "foo.py")
    wm.load_css(None)
    expected_path = os.path.join(wm.workspace_dir(), "static", "css")
    editor.load.assert_called_once_with(default_path=expected_path)
コード例 #2
0
def test_show_images():
    """
    The OS's file system explorer is opened in the correct location for the
    web application's CSS files.
    """
    editor = mock.MagicMock()
    view = mock.MagicMock()
    wm = WebMode(editor, view)
    view.current_tab.path = os.path.join(wm.workspace_dir(), "foo.py")
    wm.show_images(None)
    expected_path = os.path.join(wm.workspace_dir(), "static", "img")
    view.open_directory_from_os.assert_called_once_with(expected_path)
コード例 #3
0
ファイル: test_web.py プロジェクト: youyou5920/mu
def test_load_templates():
    """
    The OS's file system explorer is opened in the correct location for the
    templates / views used by the web application.
    """
    editor = mock.MagicMock()
    view = mock.MagicMock()
    wm = WebMode(editor, view)
    view.current_tab.path = os.path.join(wm.workspace_dir(), 'foo.py')
    wm.load_templates(None)
    expected_path = os.path.join(wm.workspace_dir(), 'templates')
    editor.load.assert_called_once_with(default_path=expected_path)