功能:字典的截取操作关键字:keep in dict

目的:只保留原字典的部分key和value值

example:创建了两个字典,分别保留关键字,name和age

RF: RobotFamework 自动化测试框架(二) 截取字典变量

运行结果:

20180524 11:21:22.413 :  INFO : &{dict1} = { name=Lily | age=18 | city='上海' }
20180524 11:21:22.415 :  INFO : &{dict2} = { name=Lucy | age=19 | city='苏州' }
20180524 11:21:22.418 :  INFO : {u'name': u'Lily', u'age': u'18', u'city': u"'\u4e0a\u6d77'"}
20180524 11:21:22.419 :  INFO : {u'name': u'Lucy', u'age': u'19', u'city': u"'\u82cf\u5dde'"}
20180524 11:21:22.420 :  INFO : Removed item with key 'city' and value ''上海''.
20180524 11:21:22.422 :  INFO : Removed item with key 'city' and value ''苏州''.
20180524 11:21:22.424 :  INFO : {u'name': u'Lily', u'age': u'18'}
20180524 11:21:22.425 :  INFO : {u'name': u'Lucy', u'age': u'19'}
Ending test:   Paasdev Suit Cases.Test.Test.test1

相关文章:

  • 2021-10-27
  • 2022-12-23
  • 2021-07-30
  • 2021-11-02
  • 2021-07-29
猜你喜欢
  • 2021-07-19
  • 2021-06-13
  • 2022-12-23
  • 2022-12-23
  • 2021-04-15
  • 2021-09-20
  • 2021-09-13
相关资源
相似解决方案