Zope Subversion Repository

  Zope

Zope: z3c.testsummarizer/trunk/src/z3c/testsummarizer/tests/test_archive.py

File: [Zope] / z3c.testsummarizer / trunk / src / z3c / testsummarizer / tests / test_archive.py (download) (as text)
Revision: 121276, Mon Apr 4 16:17:53 2011 UTC (2 years, 1 month ago) by wosc
File size: 1319 byte(s)
Add test (the first!) for the URL/date scanning logic
#############################################################################
#
# Copyright (c) 2011 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################

from z3c.testsummarizer.archive import Archive
import datetime
import pkg_resources
import unittest


class ArchiveTest(unittest.TestCase):

    def setUp(self):
        self.archive = Archive('file://' + pkg_resources.resource_filename(
            'z3c.testsummarizer.tests', 'fixtures'))

    def test_messages_are_scanned_in_reverse_chronological_order(self):
        # the datetime of the first message in the fixture is (UTC!):
        # datetime.datetime(2011, 2, 1, 5, 14, 47)
        # so we choose a window that ends after that.
        messages = self.archive.messages_sent_on(
            datetime.datetime(2011, 2, 3, 19, 0))
        self.assertEqual(28, len(messages))

webmaster@zope.org

Powered by ViewCVS 1.0-dev
(Powered by Apache)

ViewCVS and CVS Help