本文整理汇总了Python中pyasm.search.Transaction.get方法的典型用法代码示例。如果您正苦于以下问题:Python Transaction.get方法的具体用法?Python Transaction.get怎么用?Python Transaction.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.search.Transaction
的用法示例。
在下文中一共展示了Transaction.get方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_all
# 需要导入模块: from pyasm.search import Transaction [as 别名]
# 或者: from pyasm.search.Transaction import get [as 别名]
def test_all(my):
my.transaction = Transaction.get(create=True)
try:
my.create_snapshot()
my._test_base_alias()
my._test_file_naming()
my._test_file_naming_base()
my._test_dir_naming()
# this comes after test_dir_naming so the file_object doesn't get polluted
my._test_file_naming_manual_version()
my._test_get_naming()
my._test_checkin_type()
my._test_naming_util()
finally:
my.transaction.rollback()
Project.set_project('unittest')
my.test_env.delete()
my.sample3d_env.delete()
# reset the unittest project type to whatever it was
"""
示例2: test_all
# 需要导入模块: from pyasm.search import Transaction [as 别名]
# 或者: from pyasm.search.Transaction import get [as 别名]
def test_all(my):
Batch()
from pyasm.web.web_init import WebInit
WebInit().execute()
test_env = UnittestEnvironment()
test_env.create()
my.transaction = Transaction.get(create=True)
try:
my.person = Person.create( "Unit", "Test",
"ComputerWorld", "Fake Unittest Person")
my.search_type = my.person.get_search_type()
my.search_id = my.person.get_id()
my.context = "test"
my.full_context = "test/subtest"
my._test_pipeline()
my._test_pipeline_connects()
my._test_schema()
my._test_snapshot()
my._test_level()
my._test_naming_util()
my._test_sobject_hierarchy()
my._test_add_tasks()
finally:
my.transaction.rollback()
Project.set_project('unittest')
test_env.delete()
示例3: test_all
# 需要导入模块: from pyasm.search import Transaction [as 别名]
# 或者: from pyasm.search.Transaction import get [as 别名]
def test_all(self):
'''entry point function'''
self.description = "Checkin unit test"
self.errors = []
Batch()
# FIXME: this is needed for the triggers to be registerd. These
# triggers have nothing to do with the web
from pyasm.web import WebInit
WebInit().execute()
test_env = UnittestEnvironment()
test_env.create()
self.transaction = Transaction.get(create=True)
Project.set_project("unittest")
try:
#Command.execute_cmd(self)
# undo the command
#undo = UndoCmd()
#undo.execute()
self.execute()
finally:
self.transaction.rollback()
test_env.delete()
示例4: _test_cache
# 需要导入模块: from pyasm.search import Transaction [as 别名]
# 或者: from pyasm.search.Transaction import get [as 别名]
def _test_cache(self):
from pyasm.common import Config
Config.set_value("security", "mode", "cache", no_exception=True)
#Config.set_value("security", "authenticate_class", "pyasm.security.authenticate_test.AutocreateAuthenticate", no_exception=True)
Config.set_value("security", "authenticate_class", "pyasm.security.mms_authenticate.MMSAuthenticate", no_exception=True)
mode = Config.get_value("security", "authenticate_class", use_cache=False)
mode = Config.get_value("security", "mode", use_cache=False)
self.assertEquals(mode, "cache")
# verify that the user exists in the database
search = Search("sthpw/login")
search.add_filter("login", "foofoo")
login = search.get_sobject()
self.assertEquals(None, login)
from pyasm.search import Transaction
transaction = Transaction.get(create=True)
transaction.start()
self.security.login_user("foofoo", "wow")
# verify that the user exists in the database
search = Search("sthpw/login")
search.add_filter("login", "foofoo")
login = search.get_sobject()
self.assertNotEquals(None, login)
示例5: test_all
# 需要导入模块: from pyasm.search import Transaction [as 别名]
# 或者: from pyasm.search.Transaction import get [as 别名]
def test_all(self):
Batch()
from pyasm.web.web_init import WebInit
WebInit().execute()
test_env = UnittestEnvironment()
test_env.create()
self.transaction = Transaction.get(create=True)
Project.set_project('unittest')
try:
self.person = Person.create( "Unit", "Test",
"ComputerWorld", "Fake Unittest Person")
self._test_notification()
self.transaction = Transaction.get(create=True)
self._test_result()
finally:
self.transaction.rollback()
test_env.delete()
return
示例6: test_all
# 需要导入模块: from pyasm.search import Transaction [as 别名]
# 或者: from pyasm.search.Transaction import get [as 别名]
def test_all(my):
my.description = "Checkin unit test"
my.errors = []
Batch()
Project.set_project("unittest")
my.transaction = Transaction.get(create=True)
try:
my._test_create()
finally:
my.transaction.rollback()
示例7: test_all
# 需要导入模块: from pyasm.search import Transaction [as 别名]
# 或者: from pyasm.search.Transaction import get [as 别名]
def test_all(my):
Batch()
from pyasm.web.web_init import WebInit
WebInit().execute()
test_env = UnittestEnvironment()
test_env.create()
my.transaction = Transaction.get(create=True)
try:
my._test_multiple_schema()
finally:
my.transaction.rollback()
Project.set_project('unittest')
test_env.delete()
示例8: import_schema
# 需要导入模块: from pyasm.search import Transaction [as 别名]
# 或者: from pyasm.search.Transaction import get [as 别名]
def import_schema(plugin_code):
from pyasm.search import Transaction
transaction = Transaction.get(create=True)
install_dir = Environment.get_install_dir()
base_dir = Environment.get_plugin_dir()
template_dir = "%s/%s" % (base_dir, plugin_code)
manifest_path = "%s/manifest.xml" % (template_dir)
print "Reading manifest: ", manifest_path
xml = Xml()
xml.read_file(manifest_path)
# create a new project
installer = PluginInstaller(base_dir=base_dir, manifest=xml.to_string() )
installer.execute()