Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_specifying_pos_args_until_limit(self, app_token):
client = Spotify(app_token, max_limits_on=True)
s1, = client.search('piano', ('track',), None, None)
with client.max_limits(False):
s2, = client.search('piano', ('track',), None, None)
assert s1.limit > s2.limit
def test_sub_Scope_Scope_same(self):
s = Scope('a') - Scope('a')
assert str(s) == ''
def test_add_Scope_str(self):
s = Scope('a') + 'b'
assert str(s) == 'a b'
def test_scope_unpackable(self):
s1 = Scope('b', 'a')
s2 = Scope(*s1)
assert s1 == s2
def test_repr_like_instantiation(self):
s = Scope('a', 'b')
assert repr(s) == "Scope('a', 'b')"
def test_subtracting_scopes_preservers_originals(self):
s1 = Scope('b', 'a')
s2 = Scope('c', 'b')
assert isinstance(s1 - s2, Scope)
assert s1 - s2 == {'a'}
assert str(s1) == 'a b'
assert str(s2) == 'b c'
def test_scope_initialisable_with_enum(self):
s = Scope(scope.user_read_private)
assert str(s) == 'user-read-private'
def test_adding_scopes_preserves_originals(self):
s1 = Scope('b', 'a')
s2 = Scope('c', 'b')
assert isinstance(s1 + s2, Scope)
assert s1 + s2 == {'a', 'b', 'c'}
assert str(s1) == 'a b'
assert str(s2) == 'b c'
def test_adding_scopes_preserves_originals(self):
s1 = Scope('b', 'a')
s2 = Scope('c', 'b')
assert isinstance(s1 + s2, Scope)
assert s1 + s2 == {'a', 'b', 'c'}
assert str(s1) == 'a b'
assert str(s2) == 'b c'
def test_add_Scope_Scope(self):
s = Scope('a') + Scope('b')
assert str(s) == 'a b'