def setUp(self): self.config = Config("11111", ("a", "b")) self.gets_by_config = GetsByConfig(self.config, ("a", ))
def test_hash_keys(self): keys = ['a', 'b', 'c', 'd'] config = Config('111', keys) cfg = GetsByConfig(config, ('c', )) self.assertEqual(cfg.as_key(), tuple(sorted(config.as_key() + (cfg.order, ))))
def test_to_strings(self): kw = {'a': 1, 'b': 2} cfg = GetsByConfig(Config('111', kw.keys()), ('a', )) self.assertEqual(cfg.to_string(kw), '111:a=1|b=2|order_by:a')