Пример #1
0
 def dumps_attrs_in_defined_order():
     binding = Binding('x', 'y').to('new_pane', move=False)
     binding.when('foo')
     assert jsonify(binding) == dedent('''\
         {
           "keys": [
             "x",
             "y"
           ],
           "command": "new_pane",
           "args": {
             "move": false
           },
           "context": [
             {
               "key": "foo"
             }
           ]
         }''')
Пример #2
0
    def returns_true_when_attrs_are_equal():
        first = Binding('x', 'y').to('fire', a=42)
        second = Binding('x', 'y').to('fire', a=42)
        assert first == second

        first.when('foo')
        second.when('foo')
        assert first == second