• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python testapp.testapp函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中tests.testapp.testapp函数的典型用法代码示例。如果您正苦于以下问题:Python testapp函数的具体用法?Python testapp怎么用?Python testapp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了testapp函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: fakeprefs

def fakeprefs():
#    from common import setfakeprefs
    global TESTAPP
    if not TESTAPP:
        TESTAPP = True
        from tests.testapp import testapp
        testapp(prefs={'digsby.status.promote_tag.upgrade_response':True},
                logging = False)
开发者ID:AlexUlrich,项目名称:digsby,代码行数:8,代码来源:test_status.py


示例2: test_status_dialog

def test_status_dialog():
    import gettext
    gettext.install('digsby')
    from tests.testapp import testapp
    testapp('../../..')
    from social.twitter import get_snurl
    from util.threads.threadpool import ThreadPool
    ThreadPool(2)
    a = wx.PySimpleApp()
    d = TwitterStatusDialog.ShowSetStatus(None, 'foobar_username', initial_text='hello', tiny_url = get_snurl)
    d2 = TwitterStatusDialog.ShowSetStatus(None, 'foobar_username', initial_text='hello', tiny_url = get_snurl)
    assert d is d2
    d.Show()
    a.MainLoop()
开发者ID:AlexUlrich,项目名称:digsby,代码行数:14,代码来源:testtwittergui.py


示例3: main

def main():
    from tests.testapp import testapp
    import netextensions

    with testapp():
        from pprint import pprint
        OneRiotAdSource('digsby01').request_ads(pprint)
开发者ID:AlexUlrich,项目名称:digsby,代码行数:7,代码来源:feed_trends.py


示例4: main

def main():
    from tests.testapp import testapp
    from tests.mock.mockbuddy import MockBuddy
    from path import path

    a = testapp('../../..')

    from gui.imwin.messagearea import MessageArea
    from gui.imwin.styles import get_theme
    from common.logger import history_from_files
    from gui import skin

    f = wx.Frame(None, title = 'Conversation Preview')
    msgarea = MessageArea(f)

    buddy = MockBuddy('digsby01')

    theme = get_theme('GoneDark', 'Steel')
    msgarea.init_content(theme, buddy.alias, buddy, show_history = False)

    msgs = history_from_files([skin.resourcedir() / 'Example Conversation.html'])
    msgarea.replay_messages(msgs, buddy)

    f.Show()
    a.MainLoop()
开发者ID:AlexUlrich,项目名称:digsby,代码行数:25,代码来源:testthemecombos.py


示例5: main

def main():
    from tests.testapp import testapp
    app = testapp()
    f = wx.Frame(None)
    w = wx.webview.WebView(f)
    w.Bind(wx.webview.EVT_WEBVIEW_CONSOLE_MESSAGE, on_console_message)

    from gui.infobox.infoboxapp import init_host, set_hosted_content

    account = MockAccount()

    init_host(w)

    def do_set_content():
        for x in xrange(100):
            set_hosted_content(w, account)

    def on_load(e):
        if e.GetState() == wx.webview.WEBVIEW_LOAD_ONLOAD_HANDLED:
            pass
    w.Bind(wx.webview.EVT_WEBVIEW_LOAD, on_load)

    set_content_button = wx.Button(f, -1, 'set content')
    set_content_button.Bind(wx.EVT_BUTTON, lambda e: do_set_content())

    hsizer = wx.BoxSizer(wx.HORIZONTAL)
    hsizer.Add(set_content_button)

    f.Sizer = wx.BoxSizer(wx.VERTICAL)
    f.Sizer.AddMany([(hsizer, 0, wx.EXPAND), (w, 1, wx.EXPAND)])

    f.Show()

    app.MainLoop()
开发者ID:AlexUlrich,项目名称:digsby,代码行数:34,代码来源:test_webkit_hosted.py


示例6: main

def main():
    from tests.testapp import testapp
    a = testapp('../../..')
    from gui.skin.skinparse import makeImage

    b = makeImage('popupshadow.png 12 12 25 25')
    #slices = (12, 12, 25, 25)

    f = Popup(b)

    def onbutton(e):
        #f.Fit()
        f2 = Popup(b)
        f2.Size = (300, 100)
        f2.DesiredSize = Size(300, 100)
        stack.Add(f2)

    f.button.Bind(wx.EVT_BUTTON, onbutton)

    stack = PopupStack(1, BOTTOM | LEFT)
    f.DesiredSize = Size(300, 100)
    stack.Add(f)

    ctrl = wx.Frame(None)
    #slider = wx.Slider(ctrl, value = 255, minValue = 0, maxValue = 255)
    #def onslide(e):
    #    setalpha(f, slider.Value)
    #    f.border.Refresh()

        #f.SetTransparent(slider.Value)
    #slider.Bind(wx.EVT_SLIDER, onslide)
    ctrl.Show()

    a.MainLoop()
开发者ID:AlexUlrich,项目名称:digsby,代码行数:34,代码来源:alphaborder.py


示例7: main

def main():
    from common.notifications import get_notification_info
    from common.notifications import Popup

    userInfo = {None: {'contact.available': [{'reaction': Popup}],
        'contact.away': [{'reaction': Popup}],
        'email.new': [{'reaction': Popup}],
        'error': [{'reaction': Popup}],
        'facebook.alert': [{'reaction': Popup}],
        'filetransfer.request': [{'reaction': Popup}],
        'message.received.background': [{'reaction': Popup}],
        'myspace.alert': [{'reaction': Popup}]}}

    from tests.testapp import testapp
    app = testapp('../../..')

    f = wx.Frame(None, -1, 'notifications gui test')
    p = NotifyPanel(f)
    n = p.NotifyView

    n.NotificationInfo = get_notification_info()
    n.UserNotifications = userInfo

    f.Show()

    app.MainLoop()
开发者ID:AlexUlrich,项目名称:digsby,代码行数:26,代码来源:notificationlist.py


示例8: test_account_panel

def test_account_panel():
    import gettext
    gettext.install('digsby')
    from tests.testapp import testapp
    testapp('../../..')
    from util.threads.threadpool import ThreadPool
    ThreadPool(2)
    a = wx.PySimpleApp()
    f = wx.Frame(None)


    p = TwitterAccountPanel(f)
    f.SetSize((450, 350))
    f.Layout()
    f.Fit()
    f.Show()
    a.MainLoop()
开发者ID:AlexUlrich,项目名称:digsby,代码行数:17,代码来源:testtwittergui.py


示例9: main2

def main2():
    from tests.testapp import testapp
    a = testapp('../../..')

    frames = [wx.Frame(None, -1, 'test %d' % c) for c in xrange(5)]

    stack = PopupStack(1, BOTTOM | LEFT)
    stack.Add(frames[0])
开发者ID:AlexUlrich,项目名称:digsby,代码行数:8,代码来源:alphaborder.py


示例10: main

def main():
    from tests.testapp import testapp
    app = testapp()

    show_dialog()


    app.MainLoop()
开发者ID:AlexUlrich,项目名称:digsby,代码行数:8,代码来源:test_fb_yesno.py


示例11: main

def main():
    app = testapp()

    import cPickle

    fbdata_file = os.path.join(os.path.dirname(__file__), r'fbdata.dat')
    fbdata = cPickle.loads(open(fbdata_file, 'rb').read())

    benchmark(fbdata)
开发者ID:AlexUlrich,项目名称:digsby,代码行数:9,代码来源:fbbenchmark.py


示例12: main

def main():
    app = testapp()
    style = wx.STAY_ON_TOP | wx.FRAME_NO_TASKBAR | wx.FRAME_TOOL_WINDOW

    f = wx.Frame(None, style=style, pos=(400, 300), size=(300, 300))
    p = wx.Panel(f, -1)
    p.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)

    s = wx.BoxSizer(wx.VERTICAL)
    w = wx.webview.WebView(p)

    def paint(e):
        """
        i = wx.ImageFromBitmap(w.Bitmap)
        b = wx.BitmapFromImage(i)
        b.UseAlpha()
        """
        print "Hello..."
        bitmap = wx.EmptyBitmap(*w.Size)
        dc = wx.MemoryDC(bitmap)
        dc.Clear()
        # w.PaintOnDC(dc, False)

        dc.SetBrush(wx.Brush(wx.Colour(0, 0, 0, 0)))
        dc.DrawRectangle(0, 0, 400, 400)
        # dc.SetBrush(wx.RED_BRUSH)
        # dc.DrawRectangle(50, 50, 300, 200)

        if wxMSW:
            ApplyAlpha(f, bitmap)

        dc = wx.PaintDC(e.GetEventObject())
        dc.DrawBitmap(bitmap, 0, 0, True)
        # wx.ScreenDC().DrawBitmap(bitmap, 0, 0, True)

    if not wxMSW:
        p.Bind(wx.EVT_PAINT, paint)
        f.Bind(wx.EVT_PAINT, paint)

    s.Add(w, 1, wx.EXPAND)
    p.SetSizer(s)
    w.SetPageSource(html)
    f.SetTransparent(125)

    w.SetTransparent(True)

    # wx.CallLater(2000, lambda: ApplyAlpha(f, w.Bitmap))

    f.Show()

    f.SetSize((500, 500))
    if wxMSW:
        paint(None)
    app.MainLoop()
开发者ID:niterain,项目名称:digsby,代码行数:54,代码来源:transparentwebkit.py


示例13: main

def main():
    a = testapp("../../..")
    f = wx.Frame(None)

    f.fontsize = 12

    def paint(e):
        dc = wx.AutoBufferedPaintDC(f)
        dc.SetPen(wx.TRANSPARENT_PEN)
        dc.SetBrush(wx.BLACK_BRUSH)
        dc.DrawRectangleRect(f.ClientRect)

        font = wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)
        font.SetPixelSize(wx.Size(0, -f.fontsize))
        font.SetFaceName("Times New Roman")
        dc.TextForeground = wx.WHITE
        dc.Font = font

        str = "test hello world xyz"
        x, y = 40, 10
        dc.DrawText(str, x, y)
        w, h, desc, externalLeading = dc.GetFullTextExtent(str)
        print w, h, desc, externalLeading

        r = wx.Rect(x, y + desc, w, h - desc * 2)

        realHeight = h - desc * 2
        f.SetTitle("%s / %s = %s" % (f.fontsize, realHeight, f.fontsize / realHeight))

        # dc.SetPen(wx.RED_PEN)
        # dc.SetBrush(wx.TRANSPARENT_BRUSH)
        # dc.DrawRectangleRect(r)

    f.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)
    f.Bind(wx.EVT_PAINT, paint)

    sl = wx.Slider(f, minValue=-10, maxValue=50, value=f.fontsize)

    def onslide(e):
        f.fontsize = sl.Value
        f.Refresh()
        f.SetTitle(str(sl.Value))

    sl.Bind(wx.EVT_SLIDER, onslide)

    f.Sizer = s = wx.BoxSizer(wx.VERTICAL)
    s.AddStretchSpacer(1)
    s.Add(sl, 0, wx.EXPAND)

    f.Show()
    a.MainLoop()
开发者ID:niterain,项目名称:digsby,代码行数:51,代码来源:testfontsizes.py


示例14: main2

def main2():
    a = testapp('../../..')
    f = wx.Frame(None)

    from gui.skin import get as skinget
    icons = skinget('serviceicons')

    services = 'digsby aim icq jabber gtalk yahoo'.split()

    f.imgsize = 0

    def paint(e):
        dc = wx.AutoBufferedPaintDC(f)
        dc.SetPen(wx.TRANSPARENT_PEN)
        dc.SetBrush(wx.BLACK_BRUSH)
        dc.DrawRectangleRect(f.ClientRect)

        drawbitmap = dc.DrawBitmap

        sizes = [(32, 32), (16, 16), (100, 100)]

        diff = f.imgsize

        y = 0
        for size in sizes:
            x = 0
            for srv in services:
                icon = icons[srv].Resized((size[0] + diff, size[1] + diff))
                drawbitmap(icon, x, y, True)
                x += size[0] + diff
            y += size[1] + diff

    f.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)
    f.Bind(wx.EVT_PAINT, paint)

    sl = wx.Slider(f, minValue = -10, maxValue = 50, value = 0)

    def onslide(e):
        f.imgsize = sl.Value
        f.Refresh()
        f.SetTitle(str(sl.Value))


    sl.Bind(wx.EVT_SLIDER, onslide)

    f.Sizer = s = wx.BoxSizer(wx.VERTICAL)
    s.AddStretchSpacer(1)
    s.Add(sl, 0, wx.EXPAND)

    f.Show()
    a.MainLoop()
开发者ID:AlexUlrich,项目名称:digsby,代码行数:51,代码来源:testimagecaching.py


示例15: main2

def main2():
    #app = wx.PySimpleApp()
    from tests.testapp import testapp
    app = testapp()
    from gui import skin

    f = wx.Frame(None)

    f.Sizer = sizer = wx.BoxSizer(wx.VERTICAL)

    tabs = cgui.TabNotebook(f)

    def maketab(color, name):
        p = wx.Panel(f, name=name)
        def leftdown(e):
            def later():
                from gui.native.toplevel import FlashOnce
                win = p if not wx.GetKeyState(wx.WXK_SHIFT) else p.Top
                print 'flashing', win
                FlashOnce(win)


            wx.CallLater(2000, later)
            e.Skip()

        def rightdown(e):
            e.Skip()
            print tabs.SetTabActive(p)

        p.Bind(wx.EVT_LEFT_DOWN, leftdown)
        p.Bind(wx.EVT_RIGHT_DOWN, rightdown)
        p.SetBackgroundColour(color)
        sizer.Add(p, 1, wx.EXPAND)

        p.tab = tabs.CreateTab(f, MyTabController())

    maketab(wx.RED, 'foo')
    maketab(wx.BLUE, 'bar')
    maketab(wx.GREEN, 'meep')

    icon = skin.get('AppDefaults.UnreadMessageIcon')
    success = tabs.SetOverlayIcon(icon)

    print
    print '###'*30
    print success

    #print cgui.TaskbarTab()

    f.Show()
    app.MainLoop()
开发者ID:AlexUlrich,项目名称:digsby,代码行数:51,代码来源:test_taskbar.py


示例16: main

def main():
    fix_logging()
    AsyncoreThread.start()
    import wx; a = testapp('../../..')

    a.toggle_crust()

    from oscar import protocol
    oscar = protocol('digsby01', 'no passwords', user = object(), server = ('login.oscar.aol.com',5190))
    oscar.Connect()

    oscar.send_im('digsby04', u'hello world')

    a.MainLoop()
开发者ID:AlexUlrich,项目名称:digsby,代码行数:14,代码来源:testasync.py


示例17: main

def main():
    from tests.testapp import testapp
    app = testapp()

    import wx.webview
    f = wx.Frame(None, -1, size=(300, 700))

    from gui.imwin.styles.msgstyles import get_theme
    style = SocialFeedStyle(get_theme('Smooth Operator').path)

    w = wx.webview.WebView(f)
    w.SetPageSource(style.initialContents('', None, False))
    f.Show()
    app.MainLoop()
开发者ID:AlexUlrich,项目名称:digsby,代码行数:14,代码来源:socialfeed.py


示例18: main

def main():
    a = testapp()
    f = wx.Frame(None)

    bar = UberBar(f, skinkey = 'ButtonBarSkin', overflowmode = True)


    for x in xrange(5):
        title = 'test %d' % x
        b = UberButton(bar, -1, title)
        bar.Add(b)



    f.Show()
    a.MainLoop()
开发者ID:AlexUlrich,项目名称:digsby,代码行数:16,代码来源:testuberbar.py


示例19: run_tests

def run_tests():
    from tests.testapp import testapp
    app = testapp()

    runner = unittest.TextTestRunner(verbosity = 2)

    all_tests = get_tests(app)

    orig_dir = os.getcwd()
    os.chdir(unittest_basedir)
    try:
        test_result = runner.run(all_tests)
    finally:
        os.chdir(orig_dir)

    sys.exit(not test_result.wasSuccessful())
开发者ID:AlexUlrich,项目名称:digsby,代码行数:16,代码来源:runtests.py


示例20: main

def main():
    from tests.testapp import testapp

    app = testapp()
    il = WebKitImageLoader()

    def test_onLoad(img, url):
        print 'onLoad', img, url

    def test_onError(url):
        print 'onError', url

    il.on_load += test_onLoad
    il.on_error += test_onError
    il.get('http://img.digsby.com/logos/digsby_196x196.png')
    il.frame.Show()
    app.MainLoop()
开发者ID:AlexUlrich,项目名称:digsby,代码行数:17,代码来源:imageloader.py



注:本文中的tests.testapp.testapp函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python testcase.TestMode类代码示例发布时间:2022-05-27
下一篇:
Python test_utils.print_test_header函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap