Example #1
0
 def test_dict_positional_with_other_kwargs():
     args = ({"flat": ("OtherKind", "Cheese"), "app": "ehp"}, )
     kwargs = {"namespace": "over-here"}
     with pytest.raises(TypeError):
         key_module._constructor_handle_positional(args, kwargs)
Example #2
0
 def test_path_collide_flat():
     args = ("Kind", 1)
     kwargs = {"flat": ("OtherKind", "Cheese")}
     with pytest.raises(TypeError):
         key_module._constructor_handle_positional(args, kwargs)
Example #3
0
 def test_dict_positional():
     args = ({"flat": ("OtherKind", "Cheese"), "app": "ehp"}, )
     kwargs = {}
     key_module._constructor_handle_positional(args, kwargs)
     assert kwargs == args[0]
Example #4
0
 def test_with_path():
     args = ("Kind", 1)
     kwargs = {}
     key_module._constructor_handle_positional(args, kwargs)
     assert kwargs == {"flat": args}
Example #5
0
 def test_dict_positional_with_other_kwargs():
     args = ({"flat": ("OtherKind", "Cheese"), "app": "ehp"},)
     kwargs = {"namespace": "over-here"}
     with pytest.raises(TypeError):
         key_module._constructor_handle_positional(args, kwargs)
Example #6
0
 def test_dict_positional():
     args = ({"flat": ("OtherKind", "Cheese"), "app": "ehp"},)
     kwargs = {}
     key_module._constructor_handle_positional(args, kwargs)
     assert kwargs == args[0]
Example #7
0
 def test_path_collide_flat():
     args = ("Kind", 1)
     kwargs = {"flat": ("OtherKind", "Cheese")}
     with pytest.raises(TypeError):
         key_module._constructor_handle_positional(args, kwargs)
Example #8
0
 def test_with_path():
     args = ("Kind", 1)
     kwargs = {}
     key_module._constructor_handle_positional(args, kwargs)
     assert kwargs == {"flat": args}