Beispiel #1
0
 def _handleModifyCategory(self, payload):
     return AlloyData.modifyCategory(**payload)
Beispiel #2
0
from alloy.data.AlloyData import AlloyData

print 100*'-' + '\n', 'TEST: AlloyData.getCategories()'
categories = AlloyData.getCategories()
print categories

print 100*'-' + '\n', 'TEST: AlloyData.getCommands()'
commands = AlloyData.getCommands(categories[0])
print commands

print 100*'-' + '\n', 'TEST: AlloyData.createCategory()'
newCategory = AlloyData.createCategory(u'Test Category')
print newCategory

print 100*'-' + '\n', 'TEST: AlloyData.modifyCategory()'
modifiedCategory = AlloyData.modifyCategory(newCategory['id'], label=u'Mod Category')
print modifiedCategory

print 100*'-' + '\n', 'TEST: AlloyData.getCategories()'
print AlloyData.getCategories()

print 100*'-' + '\n', 'TEST: AlloyData.deleteCategory()'
deletedCategory = AlloyData.deleteCategory(modifiedCategory['id'])
print deletedCategory

print 100*'-' + '\n', 'TEST: AlloyData.createCommand()'
newCommand = AlloyData.createCommand(categories[0]['id'], 1)
print newCommand

print 100*'-' + '\n', 'TEST: AlloyData.modifyCommand()'
modifiedCommand = AlloyData.modifyCommand(