Exemplo n.º 1
0
def test_events_are_equal_when_all_attributes_are_equal():
    kwargs = build_event_kwargs()

    this = Event(**kwargs)
    that = Event(**kwargs)

    assert this.__eq__(that) is True
    assert that.__eq__(this) is True
    assert this == that
    assert not (this != that)
Exemplo n.º 2
0
def test_events_are_not_equal_if_one_attribute_is_different(
        attribute_name, different_value):
    this_kwargs = build_event_kwargs()
    this = Event(**this_kwargs)

    that_kwargs = build_event_kwargs()
    that_kwargs[attribute_name] = different_value
    that = Event(**that_kwargs)

    assert this.__eq__(that) is False
    assert that.__eq__(this) is False
    assert this != that
    assert not (this == that)