Ejemplo n.º 1
0
 def test_update_happens_when_given_other_dict(self):
     orig_dic = {"A" : "B"}
     update_dic = {"A" : 2}
     new_dic = cmd_utils.update_config(update_dic, orig_dic)
     assert new_dic["A"] == 2
     assert orig_dic["A"] == 2
Ejemplo n.º 2
0
 def test_raise_exception_when_not_given_string_or_dict(self):
     orig_dic = {"A": "B"}
     with pytest.raises(ValueError):
         cmd_utils.update_config(["a", "b"], orig_dic)
Ejemplo n.º 3
0
 def test_update_happens_when_given_correctly_formatted_string(self):
     orig_dic = {"A" : "B"}
     update_str = "A 2"
     new_dic = cmd_utils.update_config(update_str, orig_dic)
     assert new_dic["A"] == 2
     assert orig_dic["A"] == 2