def test_cart_without_provided_description(self): """A cart without items is empty""" with mock.patch('juicer.common.Constants') as constants: constants.USER_CONFIG = './config' cart = Cart('test-cart') self.assertEqual(cart.is_empty(), True) self.assertEqual(cart.repo_items_hash, {})
def test_cart_with_provided_description(self): """A cart with items is not empty""" cart = Cart('test-cart', [['test-repo', 'share/juicer/empty-0.1-1.noarch.rpm']]) self.assertEqual(cart.repos(), ['test-repo']) self.assertEqual(cart.keys(), ['test-repo']) self.assertEqual(cart.is_empty(), False) self.assertIsInstance(str(cart), str)
def run(self): cart = Cart(self.args.cartname, autoload=True, autosave=True, autosync=False) for environment in self.args.environment: cart.upload_items(environment, self.connections[environment], self.args.f)
def test_cart_with_provided_description(self): """A cart with items is not empty""" with mock.patch('juicer.common.Constants') as constants: constants.USER_CONFIG = './config' cart = Cart('test-cart', [['test-repo', 'share/juicer/empty-0.1-1.noarch.rpm']]) self.assertEqual(cart.repos(), ['test-repo']) self.assertEqual(cart.keys(), ['test-repo']) self.assertEqual(cart.is_empty(), False) self.assertIsInstance(str(cart), str)
def test_cart_without_provided_description(self): """A cart without items is empty""" cart = Cart('test-cart') self.assertEqual(cart.is_empty(), True) self.assertEqual(cart.repo_items_hash, {})
def run(self): cart = Cart(self.args.cartname) cart.delete() Log.log_info("successfully deleted cart %s" % cart.name)
def run(self): for environment in self.args.environment: Log.log_info("Starting upload for %s environment" % environment) cart = Cart('upload-cart', self.args.r) cart.upload_items(environment, self.connections[environment])
def run(self): cart = Cart(self.args.cartname, autoload=True) Log.log_info(str(cart))
def run(self): cart = Cart(self.args.cartname, autoload=False, autosave=False, autosync=False) cart.pull()
def run(self): cart = Cart(self.args.cartname) cart.delete() self.output.info("successfully deleted cart %s" % cart.name)
def run(self): Cart(self.args.cartname, self.args.r, autosave=True)
def run(self): cart = Cart(self.args.cartname, autoload=True) cart.update(self.args.r)
def run(self): cart = Cart(self.args.cartname, autoload=True) self.output.info(str(cart))