Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Match inherited tags #1064

Merged
merged 3 commits into from
Oct 7, 2016
Merged

Conversation

garberg
Copy link
Member

@garberg garberg commented Sep 28, 2016

Update the smart parser to match tags against a prefix's inherited as well as "own" tags.

Fixes #1055.

Add test case verifying matching of inherited tags and modified current
test case for smart parsing of tags.
Update the smart parser to match tags against a prefix's inherited tags
in addition to the tags added to the prefix specifically.
self.assertEqual(expected, result)

# match two levels of inherited tags
expected = [ p1.prefix ] + expected

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whitespace after '['
whitespace before ']'

self.assertEqual(expected, result)

# match an inherited tag
expected = [ p2.prefix ] + expected

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whitespace after '['
whitespace before ']'


# add a few prefixes
p1 = th.add_prefix('192.168.0.0/16', 'reservation', 'root', [ 'tag1' ])
p2 = th.add_prefix('192.168.0.0/20', 'reservation', 'test', [ 'tag2' ])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whitespace after '['
whitespace before ']'

th = TestHelper()

# add a few prefixes
p1 = th.add_prefix('192.168.0.0/16', 'reservation', 'root', [ 'tag1' ])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whitespace after '['
whitespace before ']'

@@ -1540,6 +1539,46 @@ def testPrefixInclusion(self):
self.assertEqual(expected, result)


def testTags(self):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too many blank lines (2)

Create extension citext as super user in the SQL Makefile.
@garberg
Copy link
Member Author

garberg commented Sep 28, 2016

Accidentally I also found that the creation of the citext extension never had worked in the SQL Makefile. Apparently the tests never covered it before 😄

@plajjan plajjan merged commit e6422b8 into SpriteLink:master Oct 7, 2016
@garberg garberg deleted the match_inherited_tags branch October 7, 2016 09:03
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tag searching no longer matches inherited tags
3 participants