示例#1
0
    def test_update_plugin(self):
        data = api.get_plugin('fake', '0.1').dict
        self.assertIsNotNone(data)

        updated = api.update_plugin('fake',
                                    values={
                                        'plugin_labels': {
                                            'enabled': {
                                                'status': False
                                            }
                                        }
                                    }).dict
        self.assertFalse(updated['plugin_labels']['enabled']['status'])

        updated = api.update_plugin('fake',
                                    values={
                                        'plugin_labels': {
                                            'enabled': {
                                                'status': True
                                            }
                                        }
                                    }).dict
        self.assertTrue(updated['plugin_labels']['enabled']['status'])

        # restore to original status
        updated = api.update_plugin('fake',
                                    values={
                                        'plugin_labels': data['plugin_labels']
                                    }).dict
        self.assertEqual(data['plugin_labels']['enabled']['status'],
                         updated['plugin_labels']['enabled']['status'])
示例#2
0
    def test_update_plugin(self):
        data = api.get_plugin('fake', '0.1').dict
        self.assertIsNotNone(data)

        updated = api.update_plugin('fake', values={
            'plugin_labels': {'enabled': {'status': False}}}).dict
        self.assertFalse(updated['plugin_labels']['enabled']['status'])

        updated = api.update_plugin('fake', values={
            'plugin_labels': {'enabled': {'status': True}}}).dict
        self.assertTrue(updated['plugin_labels']['enabled']['status'])

        # restore to original status
        updated = api.update_plugin('fake', values={
            'plugin_labels': data['plugin_labels']}).dict
        self.assertEqual(data['plugin_labels']['enabled']['status'],
                         updated['plugin_labels']['enabled']['status'])
示例#3
0
文件: v10.py 项目: Imperat/sahara
def plugins_update(plugin_name, data):
    return u.render(api.update_plugin(plugin_name, data).wrapped_dict)
示例#4
0
def plugins_update(plugin_name, data):
    return u.render(api.update_plugin(plugin_name, data).wrapped_dict)