Beispiel #1
0
 def test_valid_input_dict_with_too_many_string_map_values(self):
     input_dict = {"hello": "World", "goodbye": "else"}
     input_string_map = input_string_map = [("hello", "HI"), ("goodbye", "SEEYA"), ("whatever", "else")]
     output_string = build_string_from_dict(input_dict, input_string_map)
     assert output_string == "HI: World\nSEEYA: else"
Beispiel #2
0
 def test_valid_input_dict_with_incomplete_string_map(self):
     input_dict = {"hello": "World", "goodbye": "else"}
     input_string_map = [("hello", "HI")]
     output_string = build_string_from_dict(input_dict, input_string_map)
     assert output_string == "HI: World\ngoodbye: else"
Beispiel #3
0
 def test_valid_input_dict_with_string_map(self):
     input_dict = {"hello": "World", "goodbye": "else"}
     input_string_map = [("hello", "HI"), ("goodbye", "SEEYA")]
     output_string = build_string_from_dict(input_dict, input_string_map)
     assert "HI: World" in output_string
     assert "SEEYA: else" in output_string
Beispiel #4
0
 def test_valid_input_dict_no_map(self):
     input_dict = {"hello": "World", "goodbye": "else"}
     output_string = build_string_from_dict(input_dict)
     assert "hello: World" in output_string
     assert "goodbye: else" in output_string
Beispiel #5
0
 def test_ordered_dict_input(self):
     tuple_list = [("hello", "World"), ("goodbye", "else")]
     input_dict = collections.OrderedDict(tuple_list)
     output_string = build_string_from_dict(input_dict)
     assert "hello: World" in output_string
     assert "goodbye: else" in output_string
Beispiel #6
0
 def test_string_input_errors(self):
     with pytest.raises(Exception):
         build_string_from_dict("hello: World")