Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions test/unit/webdriver/log_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
Expand All @@ -19,28 +19,28 @@
from test.unit.helper.test_helper import appium_command, get_httpretty_request_body, ios_w3c_driver


class TestWebDriverLog(object):
@httpretty.activate
def test_get_log_types(self):
driver = ios_w3c_driver()
httpretty.register_uri(
httpretty.GET,
appium_command('/session/1234567890/log/types'),
body=json.dumps({'value': ['syslog']}),
)
log_types = driver.log_types
assert log_types == ['syslog']

@httpretty.activate
def test_get_log(self):
driver = ios_w3c_driver()
httpretty.register_uri(
httpretty.POST,
appium_command('/session/1234567890/log'),
body=json.dumps({'value': ['logs as array']}),
)
log_types = driver.get_log('syslog')
assert log_types == ['logs as array']

d = get_httpretty_request_body(httpretty.last_request())
assert {'type': 'syslog'} == d
@httpretty.activate
def test_get_log_types():
driver = ios_w3c_driver()
httpretty.register_uri(
httpretty.GET,
appium_command('/session/1234567890/log/types'),
body=json.dumps({'value': ['syslog']}),
)
log_types = driver.log_types
assert log_types == ['syslog']


@httpretty.activate
def test_get_log():
driver = ios_w3c_driver()
httpretty.register_uri(
httpretty.POST,
appium_command('/session/1234567890/log'),
body=json.dumps({'value': ['logs as array']}),
)
log_types = driver.get_log('syslog')
assert log_types == ['logs as array']

d = get_httpretty_request_body(httpretty.last_request())
assert {'type': 'syslog'} == d