def test_dictionary_enabled(self): dc = StenoDictionaryCollection() d1 = StenoDictionary() d1.path = 'd1' d1[('TEFT', )] = 'test1' d1[('TEFGT', )] = 'Testing' d2 = StenoDictionary() d2[('TEFT', )] = 'test2' d2[('TEFT', '-G')] = 'Testing' d2.path = 'd2' dc.set_dicts([d2, d1]) self.assertEqual(dc.lookup(('TEFT', )), 'test2') self.assertEqual(dc.raw_lookup(('TEFT', )), 'test2') self.assertEqual(dc.casereverse_lookup('testing'), ['Testing']) self.assertCountEqual(dc.reverse_lookup('Testing'), [('TEFGT', ), ('TEFT', '-G')]) d2.enabled = False self.assertEqual(dc.lookup(('TEFT', )), 'test1') self.assertEqual(dc.raw_lookup(('TEFT', )), 'test1') self.assertEqual(dc.casereverse_lookup('testing'), ['Testing']) self.assertCountEqual(dc.reverse_lookup('Testing'), [('TEFGT', )]) d1.enabled = False self.assertEqual(dc.lookup(('TEST', )), None) self.assertEqual(dc.raw_lookup(('TEFT', )), None) self.assertEqual(dc.casereverse_lookup('testing'), None) self.assertCountEqual(dc.reverse_lookup('Testing'), [])
def test_dictionary_enabled(self): dc = StenoDictionaryCollection() d1 = StenoDictionary() d1.path = 'd1' d1[('TEFT',)] = 'test1' d1[('TEFGT',)] = 'Testing' d2 = StenoDictionary() d2[('TEFT',)] = 'test2' d2[('TEFT','-G')] = 'Testing' d2.path = 'd2' dc.set_dicts([d2, d1]) self.assertEqual(dc.lookup(('TEFT',)), 'test2') self.assertEqual(dc.raw_lookup(('TEFT',)), 'test2') self.assertEqual(dc.casereverse_lookup('testing'), ['Testing']) assertCountEqual(self, dc.reverse_lookup('Testing'), [('TEFGT',), ('TEFT', '-G')]) d2.enabled = False self.assertEqual(dc.lookup(('TEFT',)), 'test1') self.assertEqual(dc.raw_lookup(('TEFT',)), 'test1') self.assertEqual(dc.casereverse_lookup('testing'), ['Testing']) assertCountEqual(self, dc.reverse_lookup('Testing'), [('TEFGT',)]) d1.enabled = False self.assertEqual(dc.lookup(('TEST',)), None) self.assertEqual(dc.raw_lookup(('TEFT',)), None) self.assertEqual(dc.casereverse_lookup('testing'), None) assertCountEqual(self, dc.reverse_lookup('Testing'), [])
def test_dictionary_enabled(): dc = StenoDictionaryCollection() d1 = StenoDictionary() d1.path = 'd1' d1[('TEFT', )] = 'test1' d1[('TEFGT', )] = 'Testing' d2 = StenoDictionary() d2[('TEFT', )] = 'test2' d2[('TEFT', '-G')] = 'Testing' d2.path = 'd2' dc.set_dicts([d2, d1]) assert dc.lookup(('TEFT', )) == 'test2' assert dc.raw_lookup(('TEFT', )) == 'test2' assert dc.casereverse_lookup('testing') == ['Testing'] assert dc.reverse_lookup('Testing') == {('TEFT', '-G'), ('TEFGT', )} d2.enabled = False assert dc.lookup(('TEFT', )) == 'test1' assert dc.raw_lookup(('TEFT', )) == 'test1' assert dc.casereverse_lookup('testing') == ['Testing'] assert dc.reverse_lookup('Testing') == {('TEFGT', )} d1.enabled = False assert dc.lookup(('TEST', )) is None assert dc.raw_lookup(('TEFT', )) is None assert dc.casereverse_lookup('testing') == [] assert dc.reverse_lookup('Testing') == set()
def test_dictionary_enabled(): dc = StenoDictionaryCollection() d1 = StenoDictionary() d1.path = 'd1' d1[('TEFT',)] = 'test1' d1[('TEFGT',)] = 'Testing' d2 = StenoDictionary() d2[('TEFT',)] = 'test2' d2[('TEFT', '-G')] = 'Testing' d2.path = 'd2' dc.set_dicts([d2, d1]) assert dc.lookup(('TEFT',)) == 'test2' assert dc.raw_lookup(('TEFT',)) == 'test2' assert dc.casereverse_lookup('testing') == ['Testing'] assert dc.reverse_lookup('Testing') == [('TEFT', '-G'), ('TEFGT',)] d2.enabled = False assert dc.lookup(('TEFT',)) == 'test1' assert dc.raw_lookup(('TEFT',)) == 'test1' assert dc.casereverse_lookup('testing') == ['Testing'] assert dc.reverse_lookup('Testing') == [('TEFGT',)] d1.enabled = False assert dc.lookup(('TEST',)) is None assert dc.raw_lookup(('TEFT',)) is None assert dc.casereverse_lookup('testing') is None assert dc.reverse_lookup('Testing') == []