Mercurial > p > roundup > code
comparison test/db_test_base.py @ 6412:a0c0ee3ed8b1
Tests for Link expressions
.. and fixes for anydbm backend, this now passes all the new tests.
| author | Ralf Schlatterbeck <rsc@runtux.com> |
|---|---|
| date | Mon, 17 May 2021 17:35:50 +0200 |
| parents | 978820fc88de |
| children | 7b1b6dffc7ed |
comparison
equal
deleted
inserted
replaced
| 6411:978820fc88de | 6412:a0c0ee3ed8b1 |
|---|---|
| 1852 grp = (None, None) | 1852 grp = (None, None) |
| 1853 for filt in iiter(): | 1853 for filt in iiter(): |
| 1854 ae(filt(None, {'status': '1'}, ('+','id'), grp), ['2','3']) | 1854 ae(filt(None, {'status': '1'}, ('+','id'), grp), ['2','3']) |
| 1855 ae(filt(None, {'status': [], 'status.name': 'unread'}), []) | 1855 ae(filt(None, {'status': [], 'status.name': 'unread'}), []) |
| 1856 ae(filt(None, {a: '-1'}, ('+','id'), grp), ['3','4']) | 1856 ae(filt(None, {a: '-1'}, ('+','id'), grp), ['3','4']) |
| 1857 # Currently works only for non-sql backends: | |
| 1858 #ae(filt(None, {a: []}, ('+','id'), grp), ['3','4']) | |
| 1859 ae(filt(None, {a: None}, ('+','id'), grp), ['3','4']) | 1857 ae(filt(None, {a: None}, ('+','id'), grp), ['3','4']) |
| 1860 ae(filt(None, {a: [None]}, ('+','id'), grp), ['3','4']) | 1858 ae(filt(None, {a: [None]}, ('+','id'), grp), ['3','4']) |
| 1861 ae(filt(None, {a: ['-1', None]}, ('+','id'), grp), ['3','4']) | 1859 ae(filt(None, {a: ['-1', None]}, ('+','id'), grp), ['3','4']) |
| 1862 ae(filt(None, {a: ['1', None]}, ('+','id'), grp), ['1', '3','4']) | 1860 ae(filt(None, {a: ['1', None]}, ('+','id'), grp), ['1', '3','4']) |
| 1861 | |
| 1862 @pytest.mark.xfail | |
| 1863 def testFilteringLinkExpression(self): | |
| 1864 ae, iiter = self.filteringSetup() | |
| 1865 a = 'assignedto' | |
| 1866 for filt in iiter(): | |
| 1867 ae(filt(None, {}, ('+',a)), ['3','4','1','2']) | |
| 1868 ae(filt(None, {a: '1'}, ('+',a)), ['1']) | |
| 1869 ae(filt(None, {a: '2'}, ('+',a)), ['2']) | |
| 1870 ae(filt(None, {a: '-1'}, ('+','status')), ['4','3']) | |
| 1871 ae(filt(None, {a: []}, ('+','id')), ['3','4']) | |
| 1872 ae(filt(None, {a: ['-1']}, ('+',a)), ['3','4']) | |
| 1873 ae(filt(None, {a: []}, ('+',a)), ['3','4']) | |
| 1874 ae(filt(None, {a: '-1'}, ('+',a)), ['3','4']) | |
| 1875 ae(filt(None, {a: ['1','-1']}), ['1','3','4']) | |
| 1876 ae(filt(None, {a: ['1','-1']}, ('+',a)), ['3','4','1']) | |
| 1877 ae(filt(None, {a: ['2','-1']}, ('+',a)), ['3','4','2']) | |
| 1878 ae(filt(None, {a: ['1','-2']}), ['2','3','4']) | |
| 1879 ae(filt(None, {a: ['1','-2']}, ('+',a)), ['3','4','2']) | |
| 1880 ae(filt(None, {a: ['-1','-2']}, ('+',a)), ['1','2']) | |
| 1881 ae(filt(None, {a: ['1','2','-3']}, ('+',a)), []) | |
| 1882 ae(filt(None, {a: ['1','2','-4']}, ('+',a)), ['1','2']) | |
| 1883 ae(filt(None, {a: ['1','-2','2','-2','-3']}, ('+',a)), ['3','4']) | |
| 1884 ae(filt(None, {a: ['1','-2','2','-2','-4']}, ('+',a)), | |
| 1885 ['3','4','1','2']) | |
| 1863 | 1886 |
| 1864 def testFilteringRevLink(self): | 1887 def testFilteringRevLink(self): |
| 1865 ae, iiter = self.filteringSetupTransitiveSearch('user') | 1888 ae, iiter = self.filteringSetupTransitiveSearch('user') |
| 1866 # We have | 1889 # We have |
| 1867 # issue assignedto | 1890 # issue assignedto |
