def test_lastChange(self):
        # First, we need to add a few changes!
        c1 = Change(who='me!',
                    branch='b1',
                    revision='1',
                    files=[],
                    comments='really important',
                    revlink='from poller')
        c2 = Change(who='me!',
                    branch='b2',
                    revision='2',
                    files=[],
                    comments='really important',
                    revlink='from poller')
        c3 = Change(who='me!',
                    branch='b1',
                    revision='3',
                    files=[],
                    comments='really important',
                    revlink='from poller')
        for c in [c1, c2, c3]:
            self.dbc.addChangeToDatabase(c)

        c = self.dbc.runInteractionNow(lambda t: lastChange(self.dbc, t, 'b1'))
        self.assertEquals(c.revision, c3.revision)

        c = self.dbc.runInteractionNow(lambda t: lastChange(self.dbc, t, 'b2'))
        self.assertEquals(c.revision, c2.revision)
    def test_lastChange(self):
        # First, we need to add a few changes!
        c1 = Change(who="me!", branch="b1", revision="1", files=[], comments="really important", revlink="from poller")
        c2 = Change(who="me!", branch="b2", revision="2", files=[], comments="really important", revlink="from poller")
        c3 = Change(who="me!", branch="b1", revision="3", files=[], comments="really important", revlink="from poller")
        for c in [c1, c2, c3]:
            self.dbc.addChangeToDatabase(c)

        c = self.dbc.runInteractionNow(lambda t: lastChange(self.dbc, t, "b1"))
        self.assertEquals(c.revision, c3.revision)

        c = self.dbc.runInteractionNow(lambda t: lastChange(self.dbc, t, "b2"))
        self.assertEquals(c.revision, c2.revision)
    def test_lastChange(self):
        # First, we need to add a few changes!
        c1 = Change(who='me!', branch='b1', revision='1', files=[], comments='really important', revlink='from poller')
        c2 = Change(who='me!', branch='b2', revision='2', files=[], comments='really important', revlink='from poller')
        c3 = Change(who='me!', branch='b1', revision='3', files=[], comments='really important', revlink='from poller')
        for c in [c1, c2, c3]:
            self.dbc.addChangeToDatabase(c)

        c = self.dbc.runInteractionNow(lambda t : lastChange(self.dbc, t, 'b1'))
        self.assertEquals(c.revision, c3.revision)

        c = self.dbc.runInteractionNow(lambda t : lastChange(self.dbc, t, 'b2'))
        self.assertEquals(c.revision, c2.revision)
    def test_lastChange_ignores_changes_with_no_revlink(self):
        c1 = Change(who='me!', branch='b1', revision='1', files=[],
                    comments='really important')
        self.dbc.addChangeToDatabase(c1)

        c = self.dbc.runInteractionNow(
            lambda t: lastChange(self.dbc, t, 'b1'))
        self.assertEquals(c, None)
    def test_lastChange_ignores_changes_with_no_revlink(self):
        c1 = Change(who='me!',
                    branch='b1',
                    revision='1',
                    files=[],
                    comments='really important')
        self.dbc.addChangeToDatabase(c1)

        c = self.dbc.runInteractionNow(lambda t: lastChange(self.dbc, t, 'b1'))
        self.assertEquals(c, None)
    def test_lastChange_ignores_changes_with_no_revlink(self):
        c1 = Change(who="me!", branch="b1", revision="1", files=[], comments="really important")
        self.dbc.addChangeToDatabase(c1)

        c = self.dbc.runInteractionNow(lambda t: lastChange(self.dbc, t, "b1"))
        self.assertEquals(c, None)