Skip to content

Commit fe519db

Browse files
Fix missing comma in test cases - originally from canonical#1474.
1 parent db6c234 commit fe519db

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

ops/framework.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -811,9 +811,9 @@ class SomeObject:
811811

812812
method_name = observer.__name__
813813

814-
assert isinstance(observer.__self__, Object), (
815-
"can't register observers " "that aren't `Object`s"
816-
)
814+
assert isinstance(
815+
observer.__self__, Object
816+
), "can't register observers that aren't `Object`s"
817817
observer_obj = observer.__self__
818818

819819
# Validate that the method has an acceptable call signature.

ops/pebble.py

+3-13
Original file line numberDiff line numberDiff line change
@@ -663,12 +663,7 @@ def from_dict(cls, d: _ProgressDict) -> TaskProgress:
663663
)
664664

665665
def __repr__(self):
666-
return (
667-
'TaskProgress('
668-
f'label={self.label!r}, '
669-
f'done={self.done!r}, '
670-
f'total={self.total!r})'
671-
)
666+
return f'TaskProgress(label={self.label!r}, done={self.done!r}, total={self.total!r})'
672667

673668

674669
class TaskID(str):
@@ -1088,12 +1083,7 @@ def from_dict(cls, d: _ServiceInfoDict) -> ServiceInfo:
10881083
)
10891084

10901085
def __repr__(self):
1091-
return (
1092-
'ServiceInfo('
1093-
f'name={self.name!r}, '
1094-
f'startup={self.startup}, '
1095-
f'current={self.current})'
1096-
)
1086+
return f'ServiceInfo(name={self.name!r}, startup={self.startup}, current={self.current})'
10971087

10981088

10991089
class Check:
@@ -2604,7 +2594,7 @@ def _encode_multipart(
26042594
source_io: _AnyStrFileLikeIO = source # type: ignore
26052595
boundary = binascii.hexlify(os.urandom(16))
26062596
path_escaped = path.replace('"', '\\"').encode('utf-8')
2607-
content_type = f"multipart/form-data; boundary=\"{boundary.decode('utf-8')}\""
2597+
content_type = f'multipart/form-data; boundary="{boundary.decode("utf-8")}"'
26082598

26092599
def generator() -> Generator[bytes, None, None]:
26102600
yield b''.join([

test/test_framework.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1982,7 +1982,8 @@ def test_breakpoint_good_names(self, request: pytest.FixtureRequest, name: str):
19821982
'-',
19831983
'...foo',
19841984
'foo.bar',
1985-
'bar--' 'FOO',
1985+
'bar--',
1986+
'FOO',
19861987
'FooBar',
19871988
'foo bar',
19881989
'foo_bar',

0 commit comments

Comments
 (0)