示例#1
0
    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)
示例#2
0
    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)
示例#3
0
    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)
示例#4
0
    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)