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

Python util.TestCase类代码示例

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

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



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

示例1: setUp

 def setUp(self):
     TestCase.setUp(self)
     self.notifier = StubNotifier()
     self.protocol = SimpleLineNotificationProtocol()
     self.protocol.notifier = self.notifier
     self.protocol.transport = StubTransport()
     self.notifier.addObserver(self.protocol)
开发者ID:svn2github,项目名称:calendarserver-raw,代码行数:7,代码来源:test_notify.py


示例2: setUp

 def setUp(self):
     """
     Create a L{MemCachePool}.
     """
     TestCase.setUp(self)
     self.reactor = StubReactor()
     self.pool = MemCachePool(MC_ADDRESS,
                              maxClients=5,
                              reactor=self.reactor)
开发者ID:svn2github,项目名称:calendarserver-raw,代码行数:9,代码来源:test_memcachepool.py


示例3: setUp

    def setUp(self):
        TestCase.setUp(self)
        self.memcache = InMemoryMemcacheProtocol()
        self.ccn = MemcacheChangeNotifier(
            StubURLResource(':memory:'),
            cachePool=self.memcache)

        self.ccn._newCacheToken = instancemethod(_newCacheToken,
                                                 self.ccn,
                                                 MemcacheChangeNotifier)
开发者ID:svn2github,项目名称:calendarserver-raw,代码行数:10,代码来源:test_cache.py


示例4: setUp

 def setUp(self):
     """
     Set up our options object, giving it a parent, and forcing the
     global config to be loaded from defaults.
     """
     TestCase.setUp(self)
     self.config = TestCalDAVOptions()
     self.config.parent = Options()
     self.config.parent["uid"] = 0
     self.config.parent["gid"] = 0
     self.config.parent["nodaemon"] = False
开发者ID:svn2github,项目名称:calendarserver-raw,代码行数:11,代码来源:test_caldav.py


示例5: setUp

    def setUp(self):
        TestCase.setUp(self)
        self.options = TestCalDAVOptions()
        self.options.parent = Options()
        self.options.parent["gid"] = None
        self.options.parent["uid"] = None
        self.options.parent["nodaemon"] = None

        self.config = ConfigDict(DEFAULT_CONFIG)

        accountsFile = os.path.join(sourceRoot, "twistedcaldav/directory/test/accounts.xml")
        resourcesFile = os.path.join(sourceRoot, "twistedcaldav/directory/test/resources.xml")
        augmentsFile = os.path.join(sourceRoot, "twistedcaldav/directory/test/augments.xml")
        pemFile = os.path.join(sourceRoot, "twistedcaldav/test/data/server.pem")

        self.config["DirectoryService"] = {
            "params": {"xmlFile": accountsFile},
            "type": "twistedcaldav.directory.xmlfile.XMLDirectoryService"
        }

        self.config["ResourceService"] = {
            "params": {"xmlFile": resourcesFile},
        }

        self.config["AugmentService"] = {
            "params": {"xmlFiles": [augmentsFile]},
            "type": "twistedcaldav.directory.augment.AugmentXMLDB"
        }

        self.config.UseDatabase    = False
        self.config.ServerRoot     = self.mktemp()
        self.config.ConfigRoot     = "config"
        self.config.ProcessType    = "Single"
        self.config.SSLPrivateKey  = pemFile
        self.config.SSLCertificate = pemFile
        self.config.EnableSSL      = True
        self.config.Memcached.Pools.Default.ClientEnabled = False
        self.config.Memcached.Pools.Default.ServerEnabled = False
        self.config.DirectoryAddressBook.Enabled = False

        self.config.SudoersFile = ""

        if self.configOptions:
            self.config.update(self.configOptions)

        os.mkdir(self.config.ServerRoot)
        os.mkdir(os.path.join(self.config.ServerRoot, self.config.DocumentRoot))
        os.mkdir(os.path.join(self.config.ServerRoot, self.config.DataRoot))
        os.mkdir(os.path.join(self.config.ServerRoot, self.config.ConfigRoot))

        self.configFile = self.mktemp()

        self.writeConfig()
开发者ID:svn2github,项目名称:calendarserver-raw,代码行数:53,代码来源:test_caldav.py


示例6: setUp

 def setUp(self):
     """
     Create a memcache client, connect it to a string protocol, and make it
     use a deterministic clock.
     """
     TestCase.setUp(self)
     self.proto = MemCacheProtocol()
     self.clock = Clock()
     self.proto.callLater = self.clock.callLater
     self.transport = StringTransportWithDisconnection()
     self.transport.protocol = self.proto
     self.proto.makeConnection(self.transport)
开发者ID:eventable,项目名称:CalendarServer,代码行数:12,代码来源:test_memcachelock.py


示例7: setUp

 def setUp(self):
     """
     Create a L{MemCachePool}.
     """
     TestCase.setUp(self)
     self.reactor = StubReactor()
     self.pool = MemCachePool(
         TCP4ClientEndpoint(self.reactor, MC_ADDRESS.host, MC_ADDRESS.port),
         maxClients=5, reactor=self.reactor
     )
     realClientFactory = self.pool.clientFactory
     self.clientFactories = []
     def capturingClientFactory(*a, **k):
         cf = realClientFactory(*a, **k)
         self.clientFactories.append(cf)
         return cf
     self.pool.clientFactory = capturingClientFactory
开发者ID:nunb,项目名称:calendarserver,代码行数:17,代码来源:test_memcachepool.py


示例8: setUp

    def setUp(self):
        """
        Create a DigestCredentialFactory for testing
        """
        TestCase.setUp(self)
        config.ProcessType = "Single"

        self.namespace1 = "DIGEST1"
        self.namespace2 = "DIGEST2"

        self.credentialFactories = (QopDigestCredentialFactory(
                                          'md5',
                                          'auth',
                                          'test realm',
                                          self.namespace1
                                      ),
                                      QopDigestCredentialFactory(
                                          'md5',
                                          '',
                                          'test realm',
                                          self.namespace2
                                      ))
开发者ID:svn2github,项目名称:calendarserver-raw,代码行数:22,代码来源:test_digest.py


示例9: setUp

    def setUp(self):
        """
        Set up our options object, giving it a parent, and forcing the
        global config to be loaded from defaults.
        """
        TestCase.setUp(self)
        self.options = CalDAVTaskOptions()
        self.options.parent = Options()
        self.options.parent["uid"] = 0
        self.options.parent["gid"] = 0
        self.options.parent["nodaemon"] = False

        self.config = ConfigDict(DEFAULT_CONFIG)

        accountsFile = os.path.join(sourceRoot, "twistedcaldav/directory/test/accounts.xml")
        self.config["DirectoryService"] = {
            "params": {"xmlFile": accountsFile},
            "type": "twistedcaldav.directory.xmlfile.XMLDirectoryService"
        }

        self.config.DocumentRoot   = self.mktemp()
        self.config.DataRoot       = self.mktemp()
        self.config.ProcessType    = "Single"
        self.config.Memcached.ClientEnabled = False
        self.config.Memcached.ServerEnabled = False


        pemFile = os.path.join(sourceRoot, "twistedcaldav/test/data/server.pem")
        self.config.SSLPrivateKey = pemFile
        self.config.SSLCertificate = pemFile

        os.mkdir(self.config.DocumentRoot)
        os.mkdir(self.config.DataRoot)

        self.configFile = self.mktemp()

        self.writeConfig()
开发者ID:svn2github,项目名称:calendarserver-raw,代码行数:37,代码来源:test_task.py


示例10: setUp

 def setUp(self):
     TestCase.setUp(self)
     self.resource = CalDAVResource()
     self.resource._dead_properties = InMemoryPropertyStore()
开发者ID:nunb,项目名称:calendarserver,代码行数:4,代码来源:test_resource.py


示例11: setUp

 def setUp(self):
     TestCase.setUp(self)
     self.handler = MailHandler(dataRoot=":memory:")
     self.dataDir = os.path.join(os.path.dirname(__file__), "data", "mail")
开发者ID:svn2github,项目名称:calendarserver-raw,代码行数:4,代码来源:test_mail.py


示例12: setUp

 def setUp(self):
     TestCase.setUp(self)
     config.setProvider(PListConfigProvider(DEFAULT_CONFIG))
     self.testConfig = self.mktemp()
     open(self.testConfig, "w").write(testConfig)
开发者ID:svn2github,项目名称:calendarserver-raw,代码行数:5,代码来源:test_config.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python timezones.TimezoneCache类代码示例发布时间:2022-05-27
下一篇:
Python util.SimpleStoreRequest类代码示例发布时间: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