示例#1
0
 def test_with_multiple_items_list(self):
     assert (formatters.parse_details(["foo", "bar",
                                       "cux"]) == "├ foo\n├ bar\n└ cux")
示例#2
0
 def test_with_one_item_list(self):
     assert formatters.parse_details(["foo"]) == "└ foo"
示例#3
0
 def test_with_one_key_dict(self):
     assert formatters.parse_details({"foo": 1}) == "└ Foo: 1"
示例#4
0
 def test_with_multiple_key_dict(self):
     assert (formatters.parse_details({
         "foo": 1,
         "bar": 2,
         "cux": 3
     }) == "├ `Foo : 1 `\n├ `Bar : 2 `\n└ `Cux : 3   `")
示例#5
0
 def test_with_empty(self, data):
     with pytest.raises(ValueError) as e:
         formatters.parse_details(data)
     assert e.value.args[0] == "data must not be null, empty, etc."