本文整理汇总了Python中utils.spin_assert函数的典型用法代码示例。如果您正苦于以下问题:Python spin_assert函数的具体用法?Python spin_assert怎么用?Python spin_assert使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了spin_assert函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_dashboard
def test_dashboard(self):
signin(self, 'bob', 'bob_secret')
spin_assert(lambda: self.assertEquals(self.browser.title,
'SylvaDB - Dashboard'))
text = self.browser.find_by_xpath(
"//header[@class='global']/h1").first.value
spin_assert(lambda: self.assertEqual(text, 'Dashboard'))
开发者ID:CulturePlex,项目名称:Sylva,代码行数:7,代码来源:dashboard.py
示例2: test_graph_change_with_permissions
def test_graph_change_with_permissions(self):
signup(self, 'alice', '[email protected]', 'alice_secret')
signin(self, 'alice', 'alice_secret')
logout(self)
signup(self, 'bob', '[email protected]', 'bob_secret')
signin(self, 'bob', 'bob_secret')
create_graph(self)
self.browser.find_by_xpath(
"//div[@class='dashboard-graphs']/div/div/span[@class='graph-title']/a"
).first.click()
add_permission(self, 'alice', CREATE_COLLAB)
add_permission(self, 'alice', GRAPH_CHANGE)
logout(self)
signin(self, 'alice', 'alice_secret')
self.browser.find_link_by_href('/graphs/bobs-graph/').first.click()
self.browser.find_by_xpath(
"//div[@class='graph-item']/span[@class='graph-title']/a"
).first.click()
self.browser.find_by_xpath("//input[@id='id_name']").first.fill(
"Alice's graph")
self.browser.find_by_xpath(
"//form/input[@type='submit']").first.click()
text = self.browser.find_by_xpath(
"//div[@class='graph-item']/span[@class='graph-title']/a"
).first.value
spin_assert(lambda: self.assertEqual(text, "Alice's graph"))
Graph.objects.get(name="Alice's graph").destroy()
开发者ID:kundeng,项目名称:Sylva,代码行数:27,代码来源:collaborator.py
示例3: test_schema_change_with_permissions
def test_schema_change_with_permissions(self):
signup(self, 'alice', '[email protected]', 'alice_secret')
signin(self, 'alice', 'alice_secret')
logout(self)
signup(self, 'bob', '[email protected]', 'bob_secret')
signin(self, 'bob', 'bob_secret')
create_graph(self)
create_schema(self)
create_type(self)
add_permission(self, 'alice', CREATE_COLLAB)
add_permission(self, 'alice', SCHEMA_VIEW)
add_permission(self, 'alice', SCHEMA_CHANGE)
logout(self)
signin(self, 'alice', 'alice_secret')
self.browser.find_link_by_href('/graphs/bobs-graph/').first.click()
self.browser.find_by_xpath(
"//nav[@class='menu']/ul/li[3]/a").first.click()
self.browser.find_by_xpath("//fieldset[@class='module aligned wide model']/h2/a").first.click()
self.browser.find_by_xpath(
"//input[@id='id_name']").first.fill("Alice's type")
self.browser.find_by_xpath("//span[@class='buttonLinkOption buttonLinkLeft']/input[@type='submit']").first.click()
text = self.browser.find_by_xpath(
"//fieldset[@class='module aligned wide model']/h2/a").first.value
spin_assert(lambda: self.assertEqual(text, "Alice's type"))
Graph.objects.get(name="Bob's graph").destroy()
开发者ID:CulturePlex,项目名称:Sylva,代码行数:25,代码来源:collaborator.py
示例4: test_data_change_without_permissions
def test_data_change_without_permissions(self):
signup(self, 'alice', '[email protected]', 'alice_secret')
signin(self, 'alice', 'alice_secret')
logout(self)
signup(self, 'bob', '[email protected]', 'bob_secret')
signin(self, 'bob', 'bob_secret')
create_graph(self)
create_schema(self)
create_type(self)
create_data(self)
add_permission(self, 'alice', CREATE_COLLAB)
add_permission(self, 'alice', DATA_VIEW)
logout(self)
signin(self, 'alice', 'alice_secret')
self.browser.find_link_by_href('/graphs/bobs-graph/').first.click()
spin_click(
self.browser.find_by_xpath("//a[@id='dataMenu']").first,
self.browser.find_by_xpath(
"//div[@id='dataBrowse']/table/tbody/tr/td/a[@class='dataOption list']"
).first)
self.browser.find_by_xpath("//td/a[@title='Edit node']").first.click()
text = self.browser.find_by_xpath(
"//div[@class='heading']/h1").first.value
spin_assert(lambda: self.assertNotEqual(text.find("403"), -1))
Graph.objects.get(name="Bob's graph").destroy()
开发者ID:kundeng,项目名称:Sylva,代码行数:25,代码来源:collaborator.py
示例5: test_data_change_with_permissions
def test_data_change_with_permissions(self):
signup(self, 'alice', '[email protected]', 'alice_secret')
signin(self, 'alice', 'alice_secret')
logout(self)
signup(self, 'bob', '[email protected]', 'bob_secret')
signin(self, 'bob', 'bob_secret')
create_graph(self)
create_schema(self)
create_type(self)
create_data(self)
add_permission(self, 'alice', CREATE_COLLAB)
add_permission(self, 'alice', DATA_VIEW)
add_permission(self, 'alice', DATA_CHANGE)
logout(self)
signin(self, 'alice', 'alice_secret')
self.browser.find_link_by_href('/graphs/bobs-graph/').first.click()
spin_click(self.browser.find_by_xpath("//a[@id='dataMenu']").first,
self.browser.find_by_xpath("//div[@id='dataBrowse']/table/tbody/tr/td/a[@class='dataOption list']").first)
self.browser.find_by_xpath("//td/a[@title='Edit node']").first.click()
self.browser.find_by_xpath(
"//input[@id='id_Name']").first.fill("Alice's node")
self.browser.find_by_xpath("//input[@type='submit']").first.click()
text = self.browser.find_by_xpath("//table[@id='content_table']/tbody/tr/td")[1].value
spin_assert(lambda: self.assertEqual(text, "Alice's node"))
Graph.objects.get(name="Bob's graph").destroy()
开发者ID:CulturePlex,项目名称:Sylva,代码行数:25,代码来源:collaborator.py
示例6: import_advanced_schema_csv
def import_advanced_schema_csv(test, name_export, name_import):
"""
Import the schema for one graph. The parameters are the name of
the graph to import and the graph from import. Csv format.
"""
create_graph(test, name_import)
spin_assert(lambda: test.assertEqual(
test.browser.title, 'SylvaDB - Dashboard'))
test.browser.find_link_by_href('/graphs/' + name_import + '/').first.click()
test.browser.is_text_present('Your Schema is empty.')
spin_assert(lambda: test.assertEqual(
test.browser.title, "SylvaDB - " + name_import))
test.browser.find_link_by_href(
'/schemas/' + name_import + '/').first.click()
spin_assert(lambda: test.assertEqual(test.browser.title, "SylvaDB - " + name_import))
test.browser.find_by_id('schemaImport').first.click()
file_path = os.path.join(
os.path.abspath(os.path.dirname(__file__)),
'files/csv/bobgraph_rel_schema.json'
)
test.browser.attach_file('file', file_path)
test.browser.find_by_value('Continue').first.click()
spin_assert(lambda: test.assertEqual(test.browser.title, "SylvaDB - " + name_import))
text = test.browser.find_by_id('diagramBoxField_' + name_import + '.bobs-type-2.undefined').first.value
spin_assert(lambda: test.assertEqual(text, "Name"))
开发者ID:CulturePlex,项目名称:Sylva,代码行数:25,代码来源:tool.py
示例7: test_data_delete_with_permissions
def test_data_delete_with_permissions(self):
signup(self, 'alice', '[email protected]', 'alice_secret')
signin(self, 'alice', 'alice_secret')
logout(self)
signup(self, 'bob', '[email protected]', 'bob_secret')
signin(self, 'bob', 'bob_secret')
create_graph(self)
create_schema(self)
create_type(self)
create_data(self)
add_permission(self, 'alice', CREATE_COLLAB)
add_permission(self, 'alice', DATA_VIEW)
add_permission(self, 'alice', DATA_CHANGE)
add_permission(self, 'alice', DATA_DELETE)
logout(self)
signin(self, 'alice', 'alice_secret')
self.browser.find_link_by_href('/graphs/bobs-graph/').first.click()
spin_click(self.browser.find_by_xpath("//a[@id='dataMenu']").first,
self.browser.find_by_xpath("//div[@id='dataBrowse']/table/tbody/tr/td/a[@class='dataOption list']").first)
self.browser.find_by_xpath("//td/a[@title='Edit node']").first.click()
self.browser.find_by_xpath("//span[@class='buttonLinkOption buttonLinkRight']/a[text()='Remove']").first.click()
self.browser.choose('confirm', '1')
self.browser.find_by_xpath("//input[@type='submit']").first.click()
text = self.browser.find_by_xpath(
"//div[@id='content2']/div[@class='indent']").first.value
spin_assert(lambda: self.assertNotEqual(text.find('Nodes: 0'), -1))
Graph.objects.get(name="Bob's graph").destroy()
开发者ID:CulturePlex,项目名称:Sylva,代码行数:27,代码来源:collaborator.py
示例8: test_user_logout
def test_user_logout(self):
signup(self, 'bob', '[email protected]', 'bob_secret')
signin(self, 'bob', 'bob_secret')
logout(self)
spin_assert(lambda: self.assertEqual(
self.browser.title, 'SylvaDB - Signed out'))
spin_assert(lambda: self.assertEqual(self.browser.find_by_css('.body-inside').first.value, 'You have been signed out. Till we meet again.'))
开发者ID:CulturePlex,项目名称:Sylva,代码行数:7,代码来源:user.py
示例9: test_query_list_view
def test_query_list_view(self):
create_graph(self)
create_schema(self)
create_type(self)
self.browser.find_by_id('queriesMenu').first.click()
button_text = self.browser.find_by_id('create-query').first.value
spin_assert(lambda: self.assertEqual(button_text, "New Query"))
开发者ID:cirocco,项目名称:Sylva,代码行数:7,代码来源:query.py
示例10: test_data_node_addition_rel_add_del
def test_data_node_addition_rel_add_del(self):
create_graph(self)
create_schema(self)
create_type(self)
create_node(self, "Bob")
create_node(self, "Alice")
# We create a allowed relation
js_code = "$('a#schema-link')[0].click();"
self.browser.execute_script(js_code)
self.browser.find_by_id('allowedRelations').first.click()
self.browser.select('source', '1')
self.browser.find_by_name('name').fill("Bob's rel")
self.browser.select('target', '1')
self.browser.find_by_id('id_description').fill("This the allowed relationship for Bob's graph")
self.browser.find_by_value('Save Type').first.click()
spin_assert(lambda: self.assertEqual(
self.browser.title, "SylvaDB - Bob's graph"))
# We create the link between the nodes
self.browser.find_by_id('dataMenu').first.click()
self.browser.find_by_xpath("//td[@class='dataActions']/a[@class='dataOption list']").first.click()
self.browser.find_by_xpath("//td[@class='dataList']/a[@class='edit']").first.click()
self.browser.find_by_xpath("//li[@class='token-input-input-token']/input").first.fill('Alice')
self.browser.is_element_present_by_id("id_user_wait", 5)
self.browser.find_by_xpath("//div[@class='token-input-dropdown']//li[@class='token-input-dropdown-item2 token-input-selected-dropdown-item']/b").first.click()
self.browser.find_by_value("Save Bob's type").first.click()
# Delete the relationship
self.browser.find_by_xpath("//td[@class='dataList']/a[@class='edit']").first.click()
self.browser.find_by_xpath("//span[@class='all-relationships incoming-relationships i_bobs_rel1-relationships']//a[@class='delete-row initial-form floating']").first.click()
self.browser.find_by_value("Save Bob's type").first.click()
self.browser.find_link_by_href('/graphs/bobs-graph/').first.click()
text = self.browser.find_by_xpath("//div[@class='flags-block']/span[@class='graph-relationships']").first.value
spin_assert(lambda: self.assertEqual(text, "0 relationships"))
Graph.objects.get(name="Bob's graph").destroy()
开发者ID:cirocco,项目名称:Sylva,代码行数:33,代码来源:data_node.py
示例11: test_user_singup_empty_password
def test_user_singup_empty_password(self):
self.browser.visit(self.live_server_url + '/accounts/signup/')
self.browser.find_by_name('username').fill('bob')
self.browser.find_by_name('email').fill('[email protected]')
self.browser.find_by_name('password1').fill('')
self.browser.find_by_name('password2').fill('bob_secret')
self.browser.find_by_value('Signup').first.click()
text = self.browser.find_by_xpath("//ul[@class='errorlist']/li").first.text
spin_assert(lambda: self.assertEqual(text, 'This field is required.'))
开发者ID:CulturePlex,项目名称:Sylva,代码行数:9,代码来源:user.py
示例12: test_user_signin_bad_password
def test_user_signin_bad_password(self):
signup(self, 'bob', '[email protected]', 'bob_secret')
self.browser.visit(self.live_server_url + '/accounts/signin/')
self.browser.find_by_name('identification').fill('bob')
self.browser.find_by_name('password').fill('alice_secret')
self.browser.find_by_xpath(
"//div[@id='body']/div/form/input")[1].click()
text = self.browser.find_by_xpath("//ul[@class='errorlist']/li").first.text
spin_assert(lambda: self.assertEqual(text, 'Please enter a correct username or email and password. Note that both fields are case-sensitive.'))
开发者ID:CulturePlex,项目名称:Sylva,代码行数:9,代码来源:user.py
示例13: test_user_signin_empty_password
def test_user_signin_empty_password(self):
signup(self, 'bob', '[email protected]', 'bob_secret')
self.browser.visit(self.live_server_url + '/accounts/signin/')
self.browser.find_by_name('identification').fill('bob')
self.browser.find_by_name('password').fill('')
self.browser.find_by_xpath(
"//div[@id='body']/div/form/input")[1].click()
text = self.browser.find_by_xpath("//ul[@class='errorlist']/li").first.text
spin_assert(lambda: self.assertEqual(text, 'This field is required.'))
开发者ID:CulturePlex,项目名称:Sylva,代码行数:9,代码来源:user.py
示例14: test_user_singup_password_unmatched
def test_user_singup_password_unmatched(self):
self.browser.visit(self.live_server_url + '/accounts/signup/')
self.browser.find_by_name('username').fill('bob')
self.browser.find_by_name('email').fill('[email protected]')
self.browser.find_by_name('password1').fill('bob_secret')
self.browser.find_by_name('password2').fill('bob_password')
self.browser.find_by_value('Signup').first.click()
text = self.browser.find_by_xpath("//ul[@class='errorlist']/li").first.text
spin_assert(lambda: self.assertEqual(
text, "The two password fields didn't match."))
开发者ID:CulturePlex,项目名称:Sylva,代码行数:10,代码来源:user.py
示例15: test_user_singup_bad_email
def test_user_singup_bad_email(self):
self.browser.visit(self.live_server_url + '/accounts/signup/')
self.browser.find_by_name('username').fill('bob')
self.browser.find_by_name('email').fill('bobcultureplex.ca')
self.browser.find_by_name('password1').fill('bob_secret')
self.browser.find_by_name('password2').fill('bob_secret')
self.browser.find_by_value('Signup').first.click()
text = self.browser.find_by_xpath("//ul[@class='errorlist']/li").first.text
spin_assert(lambda: self.assertEqual(
text, 'Enter a valid email address.'))
开发者ID:CulturePlex,项目名称:Sylva,代码行数:10,代码来源:user.py
示例16: create_schema
def create_schema(test):
"""
This function only navigates to the schema section of the graph.
"""
test.browser.find_link_by_href("/graphs/bobs-graph/").first.click()
spin_assert(lambda: test.assertEqual(test.browser.title, "SylvaDB - Bob's graph"))
js_code = "$('a#schema-link')[0].click();"
test.browser.execute_script(js_code)
text = test.browser.find_by_xpath("//div[@class='body-inside']/p").first.value
spin_assert(lambda: test.assertEqual(text, "There are no types defined yet."))
开发者ID:kundeng,项目名称:Sylva,代码行数:10,代码来源:dashboard.py
示例17: test_automatic_tour
def test_automatic_tour(self):
"""
Thist test checks that the tour starts automatically after signup, only
once.
"""
self.browser.is_element_present_by_id("wait_for_cookie_tour", 3)
signin(self, "bob", "bob_secret")
exist = self.browser.is_element_present_by_xpath("//div[@class='joyride-content-wrapper']")
spin_assert(lambda: self.assertEqual(exist, True))
self.browser.visit(self.live_server_url + "/dashboard/")
exist = self.browser.is_element_present_by_xpath("//div[@class='joyride-content-wrapper']")
spin_assert(lambda: self.assertNotEqual(exist, True))
开发者ID:kundeng,项目名称:Sylva,代码行数:12,代码来源:dashboard.py
示例18: create_data
def create_data(test):
"""
For use it after create_type(). It cretes a simple node with schema created
previously.
"""
test.browser.find_by_id("dataMenu").first.click()
test.browser.find_by_xpath("//a[@class='dataOption new']").first.click()
text = test.browser.find_by_id("propertiesTitle").first.value
spin_assert(lambda: test.assertEqual(text, "Properties"))
test.browser.find_by_name("Name").first.fill("Bob's node")
test.browser.find_by_value("Save Bob's type").first.click()
text = test.browser.find_by_xpath("//div[@class='pagination']/span[@class='pagination-info']").first.value
spin_assert(lambda: test.assertNotEqual(text.find(" elements Bob's type."), -1))
开发者ID:kundeng,项目名称:Sylva,代码行数:13,代码来源:dashboard.py
示例19: test_user_details_future_birthdate
def test_user_details_future_birthdate(self):
signup(self, 'bob', '[email protected]', 'bob_secret')
signin(self, 'bob', 'bob_secret')
spin_assert(lambda: self.assertEqual(
self.browser.title, 'SylvaDB - Dashboard'))
self.browser.find_link_by_href('/accounts/bob/').first.click()
spin_assert(lambda: self.assertEqual(
self.browser.title, "SylvaDB - bob's profile."))
self.browser.find_link_by_href('/accounts/bob/edit/').first.click()
spin_assert(lambda: self.assertEqual(
self.browser.title, 'SylvaDB - Account setup'))
self.browser.find_by_name('first_name').fill('Bob')
self.browser.find_by_name('last_name').fill('Doe')
self.browser.attach_file('mugshot', 'http://www.gravatar.com/avatar/3d4bcca5d9c3a56a0282f308f9acda07?s=90')
self.browser.select('language', 'en')
self.browser.select('gender', '1')
self.browser.find_by_name('website').fill('http://www.bobweb.com')
self.browser.find_by_name('location').fill('London, Ontario')
self.browser.find_by_name('birth_date').fill('2020-01-11')
self.browser.find_by_name('about_me').fill('I am a very nice guy')
self.browser.find_by_name('institution').fill('University')
self.browser.find_by_name('company').fill('CulturePlex')
self.browser.find_by_name('lab').fill('CulturePlex')
self.browser.find_by_value('Save changes').first.click()
text = self.browser.find_by_xpath("//ul[@class='errorlist']/li").first.text
spin_assert(lambda: self.assertEqual(
text, 'You need to introduce a past date.'))
logout(self)
开发者ID:CulturePlex,项目名称:Sylva,代码行数:28,代码来源:user.py
示例20: create_node
def create_node(test, name):
"""
It creates a node of the 'only' type in the current node.
"""
test.browser.find_by_id('dataMenu').first.click()
test.browser.find_by_xpath(
"//a[@class='dataOption new']").first.click()
text = test.browser.find_by_id('propertiesTitle').first.value
spin_assert(lambda: test.assertEqual(text, 'Properties'))
test.browser.find_by_name('Name').first.fill(name)
test.browser.find_by_xpath("//span[@class='buttonLinkOption buttonLinkLeft']/input").first.click()
text = test.browser.find_by_xpath("//div[@class='pagination']/span[@class='pagination-info']").first.value
spin_assert(lambda: test.assertNotEqual(
text.find(" elements Bob's type."), -1))
开发者ID:cirocco,项目名称:Sylva,代码行数:14,代码来源:data_node.py
注:本文中的utils.spin_assert函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论