diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-04-23 11:45:06 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-04-23 11:45:06 -0400 |
| commit | ff0fb31bf205a82c4af8781ac9afc96586a67d66 (patch) | |
| tree | 95d3d6164cdfe6104cdde2cb94daab11ec4da17c /test/base/test_utils.py | |
| parent | 713a4e19fa6c4397191dd7311152c6c69c37535e (diff) | |
| download | sqlalchemy-ff0fb31bf205a82c4af8781ac9afc96586a67d66.tar.gz | |
- merge attribute flag overhaul for [ticket:2358]
Diffstat (limited to 'test/base/test_utils.py')
| -rw-r--r-- | test/base/test_utils.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/base/test_utils.py b/test/base/test_utils.py index 3a7ce07f2..b65124c38 100644 --- a/test/base/test_utils.py +++ b/test/base/test_utils.py @@ -616,6 +616,27 @@ class SymbolTest(fixtures.TestBase): assert rt is sym1 assert rt is sym2 + def test_bitflags(self): + sym1 = util.symbol('sym1', canonical=1) + sym2 = util.symbol('sym2', canonical=2) + + assert sym1 & sym1 + assert not sym1 & sym2 + assert not sym1 & sym1 & sym2 + + def test_composites(self): + sym1 = util.symbol('sym1', canonical=1) + sym2 = util.symbol('sym2', canonical=2) + sym3 = util.symbol('sym3', canonical=4) + sym4 = util.symbol('sym4', canonical=8) + + assert sym1 & (sym2 | sym1 | sym4) + assert not sym1 & (sym2 | sym3) + + assert not (sym1 | sym2) & (sym3 | sym4) + assert (sym1 | sym2) & (sym2 | sym4) + + class WeakIdentityMappingTest(fixtures.TestBase): class Data(object): pass |
