-
Notifications
You must be signed in to change notification settings - Fork 161
Pyk: KCFG stores aliases for nodes #2647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
852f1e5
pyk: kcfg: Add tests for resolving nodes from hashes
nishantjr a9a42e5
pyk: KCFG: Only allow short hashes with '..' or '...'.
nishantjr 9d8711f
kcfg: Add more tests for bad short hashes.
nishantjr 7b7ffbb
pyk: KCFG: Resolve looks up dict of aliases
nishantjr f82f8ea
kcfg: Add remove_alias
nishantjr 48665f3
flake8
nishantjr 08b8678
Remove blank line at EOF
nishantjr 30a20ab
Fix incorrect check for short hash with two dots
nishantjr e902270
kcfg: short_name function for that returns either alias or short_hash…
nishantjr e9a87f2
kcfg: Remove alias' when node is removed.
nishantjr 498b2d2
kcfg: Use short_names in to_dot, pretty_print
nishantjr fdba4e8
short_name -> short_id
nishantjr 790eec3
Merge branch 'master' into pyk-kcfg-aliases
nishantjr 55774df
Remove unused parameter to remove_alias
nishantjr 5c6e1a1
Mark nodes that have already had their successors computed as expanded.
nishantjr dfc9ec5
Merge branch 'master' into pyk-kcfg-aliases
nishantjr 546ddba
Merge branch 'master' into pyk-kcfg-aliases
nishantjr cb84a94
Better way of getting defaults
nishantjr 19746a6
kcfg.py: Resolve ID before adding to dict
nishantjr 32b0ee1
pycfg: Pretty print: Show dangling nodes as well
nishantjr 774f5d6
Move tests for deconstruct_short_hash to test_utils
nishantjr 9737103
Use assertRaises instead of assertRaisesRegex
nishantjr aa44ddc
standardize on hashes with exactly three dots
nishantjr e69db22
kcfg: resolve Aliases must be prefixed with `@'
nishantjr c826baa
Rename short_names to short_ids. Add docstring
nishantjr e81fed7
pretty_print: Display all aliases when printing
nishantjr d94a7f6
Merge branch 'master' into pyk-kcfg-aliases
nishantjr 7140a92
Merge branch 'master' into pyk-kcfg-aliases
nishantjr 9336d8e
add_alias: Throw exception on duplicate, don't allow "@"
nishantjr 4d3459d
remove_alias: Throw if alias does not exist
nishantjr 8c4e860
to_dot: Use node_short_info
nishantjr 4af47ef
Formatting
nishantjr 5099939
Remove now unused short_id/s
nishantjr 89a4c52
More tests for deconstruct_short_hash
nishantjr 6af15d9
_resolve_all => _resolve_hash
nishantjr 3dac0e3
to_dict: Return a copy of _aliases, instead of the reference
nishantjr 9da584c
Use remove_alias() instead of del
nishantjr d1b1b64
Merge branch 'master' into pyk-kcfg-aliases
nishantjr 69071e4
Merge branch 'master' into pyk-kcfg-aliases
nishantjr 2f026b9
Merge branch 'master' into pyk-kcfg-aliases
nishantjr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| from unittest import TestCase | ||
|
|
||
| from ..utils import deconstruct_short_hash | ||
|
|
||
|
|
||
| class ShortHashTest(TestCase): | ||
| def test_parse_short_id(self): | ||
| # prefix with / without the dots, suffix, both prefix and suffix, full hash, etc). | ||
| self.assertEqual(deconstruct_short_hash('..abcdef'), ('', 'abcdef')) | ||
| self.assertEqual(deconstruct_short_hash('abcdef..'), ('abcdef', '')) | ||
| self.assertEqual(deconstruct_short_hash('abcdef..12345'), ('abcdef', '12345')) | ||
|
|
||
| full_hash = '0001000200030004000500060007000800010002000300040005000600070008' | ||
| self.assertEqual(deconstruct_short_hash(full_hash), (full_hash, full_hash)) | ||
|
|
||
| # Bad short hash: Has digits between dots | ||
| with self.assertRaises(ValueError, msg='Bad short hash: 3.c62e73544...'): | ||
| deconstruct_short_hash('3.c62e73544...') | ||
|
|
||
| # Bad short hash: Has non hex digits | ||
| with self.assertRaises(ValueError, msg='Bad short hash: 3...XXX'): | ||
| deconstruct_short_hash('3...XXX') | ||
|
|
||
| # Bad short hash: Has more than two dots | ||
| with self.assertRaises(ValueError, msg='Bad short hash: 3.....adf'): | ||
| deconstruct_short_hash('3...adf') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.