def test_Scope_len_register(): scope = Scope() scope.register(str) assert len(scope) == 1 assert tuple(scope.keys()) == (str.__name__, ) assert tuple(scope.values()) == (str, ) scope.unregister(str) assert len(scope) == 0
def test_Scope_len_register_with_name(): scope = Scope() scope.register(string=str) assert len(scope) == 1 assert tuple(scope.keys()) == ("string", ) assert tuple(scope.values()) == (str, ) assert scope.supports(str) scope.unregister(string=str) assert len(scope) == 0 assert not scope.supports(str)