diff options
author | sienkiew <sienkiew@d34015c8-bcbb-4646-8ac8-8ba5febf221d> | 2011-08-30 16:09:41 -0400 |
---|---|---|
committer | sienkiew <sienkiew@d34015c8-bcbb-4646-8ac8-8ba5febf221d> | 2011-08-30 16:09:41 -0400 |
commit | ea0bbd187c539b30c6b70a7a220ca1249f3cca41 (patch) | |
tree | bfc64ff8328e952e4348440fbe77a85aee88f48e /tests/misc.py | |
parent | 0206b3bdab5ca17b8e22806c34330dd58d55e429 (diff) | |
download | steuermann-f95cfa5c88a0ba2ce91e6892523b3107d3fd94f1.tar.gz |
hacked together prototype of steuermann 21.9
git-svn-id: https://svn.stsci.edu/svn/ssb/etal/steuermann/trunk@381 d34015c8-bcbb-4646-8ac8-8ba5febf221d
Diffstat (limited to 'tests/misc.py')
-rw-r--r-- | tests/misc.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/misc.py b/tests/misc.py new file mode 100644 index 0000000..c1d12aa --- /dev/null +++ b/tests/misc.py @@ -0,0 +1,43 @@ + +import nodes + +yes_list = ( + ( 'a:b/c', 'a:b/c' ), + ( 'a:b/*', 'a:b/c' ), + ( 'a:*/c', 'a:b/c' ), + ( 'a:*/*', 'a:b/c' ), + ( '*:b/c', 'a:b/c' ), + ( '*:b/*', 'a:b/c' ), + ( '*:*/c', 'a:b/c' ), + ( '*:*/*', 'a:b/c' ), + + ( '[a-z]:*/*', 'a:b/c' ), + + ( 'a?:*/*', 'ax:b/c' ), + ( 'a?:*/*', 'ay:b/c' ), + + ( '*:*/*', 'xasdadsf:agasdgg/asdgasdg' ), + ) + +no_list = ( + ( '[A-Z]:*/*', 'a:b/c' ), + ( 'a?:*/*', 'a:b/c' ), + ( 'a:b/*', 'a:x/y' ), + ( '*:c/*', 'a:b/y' ), + ( '*:b/y', 'a:b/c' ), + ( 'a:b/y', 'a:b/c' ), + ) + +def test_wildcard_name() : + def yes( a, b ) : + assert nodes.wildcard_name( a, b ) + + def no( a, b ) : + assert not nodes.wildcard_name( a, b ) + + for x in yes_list : + yield yes, x[0], x[1] + + for x in no_list : + yield no, x[0], x[1] + |