Example #1
0
 def _handleGetCategories(self, payload):
     return AlloyData.getCategories()
Example #2
0
# test_AlloyData.py
# (C)2012 http://www.ThreeAddOne.com
# Scott Ernst

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)