~didrocks/unity/altf10

« back to all changes in this revision

Viewing changes to grackle/tests/test_client.py

  • Committer: Curtis Hovey
  • Date: 2012-02-14 22:55:57 UTC
  • Revision ID: curtis.hovey@canonical.com-20120214225557-pi20aqjex7wtiwpl
Added test for extra data argument.

Show diffs side-by-side

added added

removed removed

Lines of Context:
565
565
        self.assertEqual(['bar', 'naf', 'qux'], ids)
566
566
 
567
567
    def test_date_range_unparsabledaterange(self):
568
 
        client = GrackleClient('localhost', 8448)
 
568
        client = GrackleClient('localhost', 8449)
569
569
        archive = {'baz': [make_message('foo', body=u'abcdefghi')]}
570
570
        with ForkedFakeService.from_client(client, archive):
571
571
            with ExpectedException(UnparsableDateRange, ''):
572
572
                client.get_messages('baz', date_range='2012-01-01')
573
573
 
574
574
    def test_date_range_unparsabledaterange_missing_part(self):
575
 
        client = GrackleClient('localhost', 8448)
 
575
        client = GrackleClient('localhost', 8450)
576
576
        archive = {'baz': [make_message('foo', body=u'abcdefghi')]}
577
577
        with ForkedFakeService.from_client(client, archive):
578
578
            with ExpectedException(UnparsableDateRange, ''):
579
579
                client.get_messages('baz', date_range='2012-01-01..')
 
580
 
 
581
    def test_date_range_unparsabledaterange_extra_part(self):
 
582
        client = GrackleClient('localhost', 8451)
 
583
        archive = {'baz': [make_message('foo', body=u'abcdefghi')]}
 
584
        with ForkedFakeService.from_client(client, archive):
 
585
            with ExpectedException(UnparsableDateRange, ''):
 
586
                client.get_messages('baz', date_range='2012-01..12-02..12-03')