コード例 #1
0
ファイル: test_client.py プロジェクト: slavitab/devpi-plumber
    def test_set_unset_volatile_flag(self):
        index = "user/index"
        users = {"user": {"password": "secret"}}
        indices = {index: {'volatile': False}}

        with TestServer(users, indices) as client:
            client.login("user", "secret")

            with volatile_index(client, index):
                self.assertIn('volatile=True', client.modify_index(index))
            self.assertIn('volatile=False', client.modify_index(index))

            with self.assertRaises(Exception):
                with volatile_index(client, 'user/index'):
                    raise Exception("Woops")
            self.assertIn('volatile=False', client.modify_index(index))
コード例 #2
0
ファイル: test_client.py プロジェクト: slavitab/devpi-plumber
    def test_throw_when_not_forced(self):
        index = "user/index"
        users = {"user": {"password": "secret"}}
        indices = {index: {'volatile': False}}

        with TestServer(users, indices) as client:
            client.login("user", "secret")

            with self.assertRaises(Exception):
                with volatile_index(client, 'user/index', force_volatile=False):
                    pass
            self.assertIn('volatile=False', client.modify_index(index))
コード例 #3
0
ファイル: client.py プロジェクト: blue-yonder/devpi-cleaner
def remove_packages(client, index, packages, force):
    with volatile_index(client, index, force):
        for package in packages:
            assert package.index == index
            client.remove('--index', package.index, '{name}=={version}'.format(name=package.name, version=package.version))