def test_remove(self): packages = [ Package('http://localhost:2414/user/index1/+f/313/8642d2b43a764/delete_me-0.2.tar.gz'), Package('http://localhost:2414/user/index1/+f/313/8642d2b43a764/delete_me-0.3.tar.gz'), ] devpi_client = Mock(spec=DevpiCommandWrapper) devpi_client.modify_index.return_value = 'volatile=True' remove_packages(devpi_client, 'user/index1', packages, False) self.assertEquals(2, devpi_client.remove.call_count)
def test_aborts_if_package_on_wrong_index(self): packages = [ Package('http://localhost:2414/user/index2/+f/313/8642d2b43a764/delete_me-0.2.tar.gz'), ] devpi_client = Mock(spec=DevpiCommandWrapper) devpi_client.modify_index.return_value = 'volatile=True' with self.assertRaises(AssertionError): remove_packages(devpi_client, 'user/index1', packages, False) self.assertLess(devpi_client.remove.call_count, 1)
def test_aborts_if_package_on_wrong_index(self): packages = [ Package( 'http://localhost:2414/user/index2/+f/313/8642d2b43a764/delete_me-0.2.tar.gz' ), ] devpi_client = Mock(spec=DevpiCommandWrapper) devpi_client.modify_index.return_value = 'volatile=True' with self.assertRaises(AssertionError): remove_packages(devpi_client, 'user/index1', packages, False) self.assertLess(devpi_client.remove.call_count, 1)
def test_remove(self): packages = [ Package( 'http://localhost:2414/user/index1/+f/313/8642d2b43a764/delete_me-0.2.tar.gz' ), Package( 'http://localhost:2414/user/index1/+f/313/8642d2b43a764/delete_me-0.3.tar.gz' ), ] devpi_client = Mock(spec=DevpiCommandWrapper) devpi_client.modify_index.return_value = 'volatile=True' remove_packages(devpi_client, 'user/index1', packages, False) self.assertEquals(2, devpi_client.remove.call_count)