Skip to content

Commit 3c7975f

Browse files
committed
Flake8ing
1 parent 638905e commit 3c7975f

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

tests/integration/test_conversations.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ def test_conversation_parts(self):
101101

102102
# def test_reply(self):
103103
# # REPLYING TO CONVERSATIONS
104-
# convo_id = Conversation.find_all(type='admin', id=self.admin.id)[0].id
104+
# convo_id = Conversation.find_all(
105+
# type='admin', id=self.admin.id)[0].id
105106
# conversation = Conversation.find(id=convo_id)
106107
# num_parts = len(conversation.conversation_parts)
107108
# # User (identified by email) replies with a comment

tests/unit/admin_spec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class DescribeIntercomAdmin:
1111

1212
@patch.object(Request, 'send_request_to_path')
13-
def it_returns_a_collection_proxy_for_all_without_making_any_requests(send_request, self):
13+
def it_returns_a_collection_proxy_for_all_without_making_any_requests(send_request, self): # noqa
1414
send_request.expects().and_raises(AssertionError)
1515
all = Admin.all()
1616
expect(all).to.be_instance_of(CollectionProxy)

tests/unit/collection_proxy_spec.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ def it_stops_iterating_if_no_next_link(self):
1818
body = json.dumps(page_of_users(include_next_link=False))
1919
httpretty.register_uri(get, r(r"/users"), body=body)
2020
emails = [user.email for user in User.all()]
21-
expect(emails) == ['user1@example.com', 'user2@example.com', 'user3@example.com']
21+
expect(emails) == ['user1@example.com', 'user2@example.com', 'user3@example.com'] # noqa
2222

2323
@httpretty.activate
2424
def it_keeps_iterating_if_next_link(self):
2525
page1 = json.dumps(page_of_users(include_next_link=True))
2626
page2 = json.dumps(page_of_users(include_next_link=False))
2727
httpretty.register_uri(get, r(r"/users$"), body=page1)
2828
httpretty.register_uri(
29-
get, r(r'https://api.intercom.io/users\?per_page=50&page=2'), body=page2,
30-
match_querystring=True)
29+
get, r(r'https://api.intercom.io/users\?per_page=50&page=2'),
30+
body=page2, match_querystring=True)
3131
emails = [user.email for user in User.all()]
32-
expect(emails) == ['user1@example.com', 'user2@example.com', 'user3@example.com'] * 2
32+
expect(emails) == ['user1@example.com', 'user2@example.com', 'user3@example.com'] * 2 # noqa
3333

3434
@httpretty.activate
3535
def it_supports_indexed_array_access(self):
@@ -42,4 +42,4 @@ def it_supports_querying(self):
4242
body = json.dumps(page_of_users(include_next_link=False))
4343
httpretty.register_uri(get, r(r"/users"), body=body)
4444
emails = [user.email for user in User.find_all(tag_name='Taggart J')]
45-
expect(emails) == ['user1@example.com', 'user2@example.com', 'user3@example.com']
45+
expect(emails) == ['user1@example.com', 'user2@example.com', 'user3@example.com'] # noqa

tests/unit/intercom_spec.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def before_each(self, context):
2323
self.intercom.app_id = 'abc123'
2424
self.intercom.app_api_key = 'super-secret-key'
2525

26-
def it_raises_argumenterror_if_no_app_id_or_app_api_key_specified(self):
26+
def it_raises_argumenterror_if_no_app_id_or_app_api_key_specified(self): # noqa
2727
self.intercom.app_id = None
2828
self.intercom.app_api_key = None
2929
with expect.to_raise_error(intercom.ArgumentError):
@@ -58,21 +58,21 @@ def it_allows_overriding_of_the_endpoint_and_protocol(self):
5858

5959
def it_prefers_endpoints(self):
6060
self.intercom.endpoint = "https://localhost:7654"
61-
expect(self.intercom.target_base_url) == "https://abc123:super-secret-key@localhost:7654"
61+
expect(self.intercom.target_base_url) == "https://abc123:super-secret-key@localhost:7654" # noqa
6262

6363
# turn off the shuffle
6464
with mock.patch("random.shuffle") as mock_shuffle:
65-
mock_shuffle.return_value = ["http://example.com", "https://localhost:7654"]
66-
self.intercom.endpoints = ["http://example.com", "https://localhost:7654"]
65+
mock_shuffle.return_value = ["http://example.com", "https://localhost:7654"] # noqa
66+
self.intercom.endpoints = ["http://example.com", "https://localhost:7654"] # noqa
6767
expect(self.intercom.target_base_url) == \
6868
'http://abc123:super-secret-key@example.com'
6969

7070
def it_has_endpoints(self):
7171
expect(self.intercom.endpoints) == ["https://api.intercom.io"]
72-
self.intercom.endpoints = ["http://example.com","https://localhost:7654"]
73-
expect(self.intercom.endpoints) == ["http://example.com","https://localhost:7654"]
72+
self.intercom.endpoints = ["http://example.com", "https://localhost:7654"] # noqa
73+
expect(self.intercom.endpoints) == ["http://example.com", "https://localhost:7654"] # noqa
7474

75-
def it_should_randomize_endpoints_if_last_checked_endpoint_is_gt_5_minutes_ago(self):
75+
def it_should_randomize_endpoints_if_last_checked_endpoint_is_gt_5_minutes_ago(self): # noqa
7676
now = time.mktime(datetime.utcnow().timetuple())
7777
self.intercom._endpoint_randomized_at = now
7878
self.intercom.endpoints = ["http://alternative"]
@@ -82,4 +82,3 @@ def it_should_randomize_endpoints_if_last_checked_endpoint_is_gt_5_minutes_ago(s
8282
expect(self.intercom.current_endpoint) == "http://start"
8383
self.intercom._endpoint_randomized_at = now - 360
8484
expect(self.intercom.current_endpoint) == "http://alternative"
85-

tests/unit/traits/api_resource_spec.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def it_does_not_set_type_on_parsing_json(self):
2727
expect(self.api_resource).to_not.have_attr('type')
2828

2929
def it_coerces_time_on_parsing_json(self):
30-
expect(datetime.fromtimestamp(1374056196)) == self.api_resource.created_at
30+
expect(datetime.fromtimestamp(1374056196)) == self.api_resource.created_at # noqa
3131

3232
def it_dynamically_defines_accessors_for_non_existent_properties(self):
3333
expect(self.api_resource).to_not.have_attr('spiders')
@@ -46,8 +46,8 @@ def it_exposes_dates_correctly_for_dynamically_defined_getters(self):
4646
self.api_resource.foo_at = 1401200468
4747
expect(datetime.fromtimestamp(1401200468)) == self.api_resource.foo_at
4848

49-
# def it_throws_regular_error_when_non_existant_getter_is_called_that_is_backed_by_an_instance_variable(self):
50-
# super(Resource, self.api_resource).__setattr__('bar', 'you cant see me')
49+
# def it_throws_regular_error_when_non_existant_getter_is_called_that_is_backed_by_an_instance_variable(self): # noqa
50+
# super(Resource, self.api_resource).__setattr__('bar', 'you cant see me') # noqa
5151
# print self.api_resource.bar
5252

5353
def it_throws_attribute_error_when_non_existent_attribute_is_called(self):
@@ -62,9 +62,9 @@ def it_throws_attribute_error_when_non_existent_setter_is_called(self):
6262
with expect.to_raise_error(AttributeError):
6363
self.api_resource.flubber('a', 'b')
6464

65-
def it_create_an_initialized_resource_equal_to_a_from_response_resource(self):
65+
def it_create_an_initialized_resource_equal_to_a_from_response_resource(self): # noqa
6666
initialized_api_resource = Resource(**self.object_json)
6767
for key in self.object_json.keys():
6868
if key == "type":
6969
continue
70-
expect(getattr(initialized_api_resource, key)) == getattr(self.api_resource, key)
70+
expect(getattr(initialized_api_resource, key)) == getattr(self.api_resource, key) # noqa

0 commit comments

Comments
 (0)