def test_update_userdata__without_cmdline_defines(self): config = Configuration("", load_config=False) config.userdata = UserData(person1="AAA", person3="Charly") config.update_userdata(dict(person1="Alice", person2="Bob")) expected_data = dict(person1="Alice", person2="Bob", person3="Charly") eq_(config.userdata, expected_data) self.assertFalse(config.userdata_defines)
def test_update_userdata__with_cmdline_defines(self): # -- NOTE: cmdline defines are reapplied. config = Configuration("-D person2=Bea", load_config=False) config.userdata = UserData(person1="AAA", person3="Charly") config.update_userdata(dict(person1="Alice", person2="Bob")) expected_data = dict(person1="Alice", person2="Bea", person3="Charly") eq_(config.userdata, expected_data) eq_(config.userdata_defines, [("person2", "Bea")])