コード例 #1
0
    def testRepr(self):
        comment = statetracker.DocComment(None)
        comment.AddFlag(self._MakeDocFlagFake('param', 'foo'))
        comment.AddFlag(self._MakeDocFlagFake('param', 'bar'))

        self.assertEquals(
            '<DocComment: [\'foo\', \'bar\'], [@param foo, @param bar]>',
            repr(comment))
コード例 #2
0
    def testSuppressionOnly(self):
        comment = statetracker.DocComment(None)

        self.assertFalse(comment.SuppressionOnly())
        comment.AddFlag(self._MakeDocFlagFake('suppress'))
        self.assertTrue(comment.SuppressionOnly())
        comment.AddFlag(self._MakeDocFlagFake('foo'))
        self.assertFalse(comment.SuppressionOnly())
コード例 #3
0
    def testInvalidate(self):
        comment = statetracker.DocComment(None)

        self.assertFalse(comment.invalidated)
        self.assertFalse(comment.IsInvalidated())

        comment.Invalidate()

        self.assertTrue(comment.invalidated)
        self.assertTrue(comment.IsInvalidated())
コード例 #4
0
    def testDocFlags(self):
        comment = statetracker.DocComment(None)

        a = self._MakeDocFlagFake('param', 'foo')
        comment.AddFlag(a)

        b = self._MakeDocFlagFake('param', '')
        comment.AddFlag(b)

        c = self._MakeDocFlagFake('param', 'bar')
        comment.AddFlag(c)

        self.assertEquals(['foo', 'bar'], comment.ordered_params)

        self.assertEquals([a, b, c], comment.GetDocFlags())