def test_coerceProductReturn(self): """ Verify that L{ProductFragment.coerceProduct} returns a string indicating success. """ createdProducts = [] fragment = ProductFragment(StubProductConfiguration(createdProducts)) result = fragment.coerceProduct() self.assertEqual(result, u'Created.')
def test_coerceProduct(self): """ Verify that L{ProductFragment.coerceProduct} calls C{createProduct} on the object it wraps and passes its arguments through. """ createdProducts = [] fragment = ProductFragment(StubProductConfiguration(createdProducts)) fragment.coerceProduct(foo=u'bar', baz=u'quux') self.assertEqual(map(sorted, createdProducts), [[u'bar', u'quux']])
def test_coerceProduct(self): """ Verify that L{ProductFragment.coerceProduct} calls C{createProduct} on the object it wraps and passes its arguments through. """ createdProducts = [] fragment = ProductFragment(StubProductConfiguration(createdProducts)) fragment.coerceProduct(foo=u'bar', baz=u'quux') self.assertEqual(createdProducts, [[u'bar', u'quux']])