def test_allow_middlewares_and_processors_through_kwargs(self): a1 = AbstractAdapter({ 'foo': 1 }, middlewares=[1], processors=[2]) a3 = a1.merge(bar='2', middlewares=[1], processors=[2]) self.assertEqual(a3.config['foo'], 1) self.assertEqual(a3.config['bar'], '2') self.assertEqual(a3.middlewares, [1]) self.assertEqual(a3.processors, [2])
def test_takes_dict(self): a1 = AbstractAdapter({ 'foo': 1 }, middlewares=[1], processors=[2]) a3 = a1.merge({'bar': 2}) self.assertEqual(a3.config['foo'], 1) self.assertEqual(a3.config['bar'], 2) self.assertEqual(a3.middlewares, [1]) self.assertEqual(a3.processors, [2])
def test_allow_middlewares_and_processors_through_kwargs(self): a1 = AbstractAdapter({'foo': 1}, middlewares=[1], processors=[2]) a3 = a1.merge(bar='2', middlewares=[1], processors=[2]) self.assertEqual(a3.config['foo'], 1) self.assertEqual(a3.config['bar'], '2') self.assertEqual(a3.middlewares, [1]) self.assertEqual(a3.processors, [2])
def test_takes_dict(self): a1 = AbstractAdapter({'foo': 1}, middlewares=[1], processors=[2]) a3 = a1.merge({'bar': 2}) self.assertEqual(a3.config['foo'], 1) self.assertEqual(a3.config['bar'], 2) self.assertEqual(a3.middlewares, [1]) self.assertEqual(a3.processors, [2])
def test_takes_instance_of_adapter(self): a1 = AbstractAdapter({ 'foo': 1 }) a2 = AbstractAdapter({ 'bar': 2 }) a3 = a1.merge(a2) self.assertEqual(a1.config['foo'], 1) self.assertEqual(a2.config['bar'], 2) self.assertEqual(a3.config['foo'], 1) self.assertEqual(a3.config['bar'], 2)
def test_takes_instance_of_adapter(self): a1 = AbstractAdapter({'foo': 1}) a2 = AbstractAdapter({'bar': 2}) a3 = a1.merge(a2) self.assertEqual(a1.config['foo'], 1) self.assertEqual(a2.config['bar'], 2) self.assertEqual(a3.config['foo'], 1) self.assertEqual(a3.config['bar'], 2)
def test_takes_keywords(self): a1 = AbstractAdapter({ 'foo': 1 }) a3 = a1.merge(bar=2) self.assertEqual(a3.config['foo'], 1) self.assertEqual(a3.config['bar'], 2)
def test_takes_keywords(self): a1 = AbstractAdapter({'foo': 1}) a3 = a1.merge(bar=2) self.assertEqual(a3.config['foo'], 1) self.assertEqual(a3.config['bar'], 2)