示例#1
0
 def test_dict_raises_for_differing_length_key_value_pairs(self):
     l = collections.Dict()
     with Flow(name="test") as f:
         l.bind(keys=["a"], values=[1, 2])
     state = f.run()
     assert state.result[l].is_failed()
     assert isinstance(state.result[l].result, ValueError)
示例#2
0
 def test_dict_returns_a_dict(self):
     l = collections.Dict()
     with Flow(name="test") as f:
         l.bind(keys=["a", "b"], values=[1, 2])
     assert f.run().result[l].result == dict(a=1, b=2)
示例#3
0
 def test_dict_handles_non_string_keys(self):
     l = collections.Dict()
     with Flow(name="test") as f:
         l.bind(keys=[None, 55], values=[1, 2])
     assert f.run().result[l].result == {None: 1, 55: 2}
示例#4
0
 def test_dict_returns_a_dict(self):
     l = collections.Dict()
     with Flow(name="test") as f:
         l.bind(a=1, b=2)
     assert f.run().result[l].result == dict(a=1, b=2)