Exemplo n.º 1
0
def suite():
    # This is a classmethod which is present in all the KamTestCases. The
    # method returns a unittest-compatible TestCase, that will behave as
    # explained above, but through the standard unittest API. Thanks to this,
    # these tests can be integrated in any framework which relies on unittest,
    # so it may be easily integrated into software as apycot or CruiseControl, 
    # etc.
    unittestCompatibleTestCase = SimpleComponentTestCase.getTestCase()
    return KamTestCase.makeSuite(unittestCompatibleTestCase)
Exemplo n.º 2
0
def suite():
    """
    This method is not required, but it's useful to build a unittest-compatible
    TestSuite

    This is a classmethod which is present in all the KamTestCases.
    
    The method returns a unittest-compatible TestCase, that will behave as
    explained above, but through the standard unittest API.
    
    Thanks to this, these tests can be integrated in any framework which
    relies on unittest, so it may be easily integrated into software as
    apycot or CruiseControl, etc.
    """

    unittestCompatibleTestCase = SimpleComponentTestCase.getTestCase()
    return KamTestCase.makeSuite(unittestCompatibleTestCase)
Exemplo n.º 3
0
def suite():
    return KamTestCase.makeSuite(SimpleComponentTestCase.getTestCase())
Exemplo n.º 4
0
def suite():
    return KamTestCase.makeSuite(PostSorterTestCase.getTestCase())
Exemplo n.º 5
0
def suite():
    return KamTestCase.TestSuite((
        KamTestCase.makeSuite(FeedParserTestCase.getTestCase()),
        KamTestCase.makeSuite(FeedParserFactoryTestCase.getTestCase()),
    ))
Exemplo n.º 6
0
            # And we see how SimpleComponent acts consecuentially
            dataReceived = self.get("outbox", timeout=1)
            self.assertEquals("this.is.from.the.mock", dataReceived)

            # With different outboxes (and inboxes) still works
            self.mockedComponent.addMessage("this.is.from.the.mock2", "outbox2")
            dataReceived = self.get("outbox", timeout=1)
            self.assertEquals("this.is.from.the.mock2", dataReceived)

            # We finish the mock object
            self.mockedComponent.stopMockObject()

            # Then kill the tested object
            msg = producerFinished()
            self.put(msg, "control")
            dataReceived = self.get("signal")
            self.assertEquals(msg, dataReceived)

            # And after it... nothing else
            self.assertOutboxEmpty("control")
            self.assertOutboxEmpty("outbox")


def suite():
    return KamTestCase.makeSuite(SimpleComponentTestCase.getTestCase())


if __name__ == "__main__":
    KamTestCase.main(defaultTest="suite")
Exemplo n.º 7
0
        the_past_date   = (cur_year - 1, ) + the_date[1:]
        
        feeds.extend(self.generateFeeds(2, self.NO_DATE,    'notime'))
        feeds.extend(self.generateFeeds(2, the_future_date, 'future'))
        feeds.extend(self.generateFeeds(2, the_past_date,   'past'))
        feeds.extend(self.generateFeeds(2, the_date,        'present'))
        feeds.extend(self.generateFeeds(2, self.NO_DATE,    'notime'))
        
        configObject = self.createConfigObject(5)
        self.put(configObject, 'config-inbox')
        
        for feed in feeds:
            self.put(feed, 'inbox')
        self.put(producerFinished(), "control")
        for _ in range(2):
            msg = self.get('outbox')
            self.assertEquals(cur_year + 1, msg['entry']['updated_parsed'][0])
        for _ in range(2):
            msg = self.get('outbox')
            self.assertEquals(cur_year    , msg['entry']['updated_parsed'][0])
        for _ in range(1):
            msg = self.get('outbox')
            self.assertEquals(cur_year - 1, msg['entry']['updated_parsed'][0])
        self.assertOutboxEmpty('outbox')

def suite():
    return KamTestCase.makeSuite(PostSorterTestCase.getTestCase())

if __name__ == '__main__':
    KamTestCase.main(defaultTest='suite')
Exemplo n.º 8
0
        self.initializeSystem(self.simpleSample)

    def testForwardsNumbers(self):
        self.put(5, 'numbers')
        self.put(6, 'numbers')
        self.put(producerFinished(), 'control')
        self.assertEquals('5', self.get('outbox'))
        self.assertEquals('6', self.get('outbox'))
        self.assertOutboxEmpty('outbox')
        self.assertTrue(isinstance(self.get('signal'), producerFinished))
        self.assertOutboxEmpty('signal')

    def testForwardsNumbersWithExpect(self):
        self.put(5, 'numbers')
        self.put(6, 'numbers')
        self.put(7, 'numbers')
        self.put(producerFinished(), 'control')
        self.expect(KamExpectMatcher.RegexpMatcher('^6$'), 'outbox')
        self.assertEquals('7', self.get('outbox'))
        self.assertOutboxEmpty('outbox')
        self.assertTrue(isinstance(self.get('signal'), producerFinished))
        self.assertOutboxEmpty('signal')


def suite():
    return KamTestCase.makeSuite(SimpleSampleTestCase.getTestCase())


if __name__ == '__main__':
    KamTestCase.main(defaultTest='suite')
def suite():
    return KamTestCase.makeSuite(GeneralObjectParserTestCase.getTestCase())
Exemplo n.º 10
0
def suite():
    return KamTestCase.makeSuite(ConfigFileParserTestCase.getTestCase())
Exemplo n.º 11
0
def suite():
    return KamTestCase.makeSuite(ConfigFileParserTestCase.getTestCase())
Exemplo n.º 12
0
def suite():
    return KamTestCase.makeSuite(IntegrationTestCase.getTestCase())
Exemplo n.º 13
0
def suite():
    return KamTestCase.makeSuite(ForwarderComponentTestCase.getTestCase())
Exemplo n.º 14
0
def suite():
    return KamTestCase.makeSuite(SimpleHTTPClientTestCase.getTestCase())
Exemplo n.º 15
0
def suite():
    return KamTestCase.makeSuite(KamTemplateProcessorTestCase.getTestCase())
Exemplo n.º 16
0
def suite():
    return KamTestCase.makeSuite(
            MessagingThroughPipelineTestCase.getTestCase()
        )
Exemplo n.º 17
0
def suite():
    return KamTestCase.makeSuite(ForwarderComponentTestCase.getTestCase())
Exemplo n.º 18
0
def suite():
    return KamTestCase.makeSuite(IntegrationTestCase.getTestCase())
Exemplo n.º 19
0
def suite():
    return KamTestCase.makeSuite(SimpleSampleTestCase.getTestCase())
def suite():
    return KamTestCase.makeSuite(KamTemplateProcessorTestCase.getTestCase())
Exemplo n.º 21
0
def suite():
    return KamTestCase.makeSuite(PostSorterTestCase.getTestCase())
Exemplo n.º 22
0
def suite():
    return KamTestCase.makeSuite(SimpleHTTPClientTestCase.getTestCase())
Exemplo n.º 23
0
def suite():
    return KamTestCase.makeSuite(SimpleComponentTestCase.getTestCase())
Exemplo n.º 24
0
def suite():
    return KamTestCase.TestSuite((
                KamTestCase.makeSuite(FeedParserTestCase.getTestCase()), 
                KamTestCase.makeSuite(FeedParserFactoryTestCase.getTestCase()), 
            ))