def test_length__with_scoped_params(self): userdata1 = UserData({"my.scope.param1": "123"}) userdata2 = UserData({ "my.other_scope.param1": "123", "my.scope.param1": "123", "my.scope.param2": "456", }) userdata3 = UserData({ "my.other_scope.param1": "123", "my.scope.param1": "123", "my.scope.param2": "456", "my.scope.param3": "789", "my.other_scope.param2": "123", }) config = UserDataNamespace("my.scope") config.data = userdata1 assert len(config) == 1 config.data = userdata2 assert len(config) == 2 config.data = userdata3 assert len(config) == 3
def test_length__with_scoped_params(self): userdata1 = UserData({"my.scope.param1": "123"}) userdata2 = UserData({ "my.other_scope.param1": "123", "my.scope.param1": "123", "my.scope.param2": "456", }) userdata3 = UserData({ "my.other_scope.param1": "123", "my.scope.param1": "123", "my.scope.param2": "456", "my.scope.param3": "789", "my.other_scope.param2": "123", }) config = UserDataNamespace("my.scope") config.data = userdata1 assert len(config) == 1 config.data = userdata2 assert len(config) == 2 config.data = userdata3 assert len(config) == 3
def test_ctor__can_assign_userdata_afterwards(self): userdata = UserData({"my.scope.param1": 12}) config = UserDataNamespace("my.scope") config.data = userdata assert isinstance(config.data, UserData) assert config.data is userdata
def test_ctor__can_assign_userdata_afterwards(self): userdata = UserData({"my.scope.param1": 12}) config = UserDataNamespace("my.scope") config.data = userdata assert isinstance(config.data, UserData) assert config.data is userdata