diff options
author | Tres Seaver <tseaver@palladion.com> | 2021-06-16 13:45:41 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-16 13:45:41 -0400 |
commit | fbf447cf25468dfa7e99283ce66a9c10daacc488 (patch) | |
tree | 3f6725ebb6ecf81dc502cdf71ec2da174076e32a /tests/unit/test_bidi.py | |
parent | 11032cf08ecc16dd252a6cda8b33b0b28ec4f4ba (diff) | |
download | python-api-core-fbf447cf25468dfa7e99283ce66a9c10daacc488.tar.gz |
chore: blacken (#206)
Also, fix 2.7 tests broken by release of 'googleapis-common-protos 1.53.0',
which dropped Python 2.7 support.
Closes #169
Diffstat (limited to 'tests/unit/test_bidi.py')
-rw-r--r-- | tests/unit/test_bidi.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/unit/test_bidi.py b/tests/unit/test_bidi.py index 52215cb..602d640 100644 --- a/tests/unit/test_bidi.py +++ b/tests/unit/test_bidi.py @@ -121,21 +121,18 @@ class Test_Throttle(object): def test_repr(self): delta = datetime.timedelta(seconds=4.5) instance = bidi._Throttle(access_limit=42, time_window=delta) - assert repr(instance) == \ - "_Throttle(access_limit=42, time_window={})".format(repr(delta)) + assert repr(instance) == "_Throttle(access_limit=42, time_window={})".format( + repr(delta) + ) def test_raises_error_on_invalid_init_arguments(self): with pytest.raises(ValueError) as exc_info: - bidi._Throttle( - access_limit=10, time_window=datetime.timedelta(seconds=0.0) - ) + bidi._Throttle(access_limit=10, time_window=datetime.timedelta(seconds=0.0)) assert "time_window" in str(exc_info.value) assert "must be a positive timedelta" in str(exc_info.value) with pytest.raises(ValueError) as exc_info: - bidi._Throttle( - access_limit=0, time_window=datetime.timedelta(seconds=10) - ) + bidi._Throttle(access_limit=0, time_window=datetime.timedelta(seconds=10)) assert "access_limit" in str(exc_info.value) assert "must be positive" in str(exc_info.value) @@ -461,7 +458,9 @@ class TestResumableBidiRpc(object): ) should_recover = mock.Mock(spec=["__call__"], return_value=False) should_terminate = mock.Mock(spec=["__call__"], return_value=True) - bidi_rpc = bidi.ResumableBidiRpc(start_rpc, should_recover, should_terminate=should_terminate) + bidi_rpc = bidi.ResumableBidiRpc( + start_rpc, should_recover, should_terminate=should_terminate + ) bidi_rpc.open() @@ -527,7 +526,9 @@ class TestResumableBidiRpc(object): ) should_recover = mock.Mock(spec=["__call__"], return_value=False) should_terminate = mock.Mock(spec=["__call__"], return_value=True) - bidi_rpc = bidi.ResumableBidiRpc(start_rpc, should_recover, should_terminate=should_terminate) + bidi_rpc = bidi.ResumableBidiRpc( + start_rpc, should_recover, should_terminate=should_terminate + ) bidi_rpc.open() |