1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-10-30 22:54:14 +00:00

Make CorrectedCommand ignore priority when checking equality

This commit is contained in:
nvbn
2015-09-01 13:03:24 +03:00
parent 12394ca842
commit 5d74344994
2 changed files with 38 additions and 8 deletions

View File

@@ -44,3 +44,16 @@ class TestSortedCorrectedCommandsSequence(object):
settings)
assert set(seq) == {CorrectedCommand('ls', priority=100),
CorrectedCommand('ls', side_effect, 300)}
class TestCorrectedCommand(object):
def test_equality(self):
assert CorrectedCommand('ls', None, 100) == \
CorrectedCommand('ls', None, 200)
assert CorrectedCommand('ls', None, 100) != \
CorrectedCommand('ls', lambda *_: _, 100)
def test_hashable(self):
assert {CorrectedCommand('ls', None, 100),
CorrectedCommand('ls', None, 200)} == {CorrectedCommand('ls')}