Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Filter: Fix FilterContinuous eq operator #1784

Merged
merged 1 commit into from
Dec 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Orange/data/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def __call__(self, inst):
def __eq__(self, other):
return isinstance(other, FilterContinuous) and \
self.column == other.column and self.oper == other.oper and \
self.oper == other.oper and self.oper == other.oper
self.ref == other.ref and self.max == other.max

def __str__(self):
if isinstance(self.column, str):
Expand Down
8 changes: 8 additions & 0 deletions Orange/tests/test_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,22 @@ def test_str(self):
def test_eq(self):
flt1 = FilterContinuous(1, FilterContinuous.Between, 1, 2)
flt2 = FilterContinuous(1, FilterContinuous.Between, 1, 2)
flt3 = FilterContinuous(1, FilterContinuous.Between, 1, 3)
self.assertEqual(flt1, flt2)
self.assertNotEqual(flt1, flt3)
self.assertEqual(flt1.__dict__ == flt2.__dict__, flt1 == flt2)
self.assertEqual(flt1.__dict__ == flt3.__dict__, flt1 == flt3)


class TestFilterDiscrete(unittest.TestCase):
def test_eq(self):
flt1 = FilterDiscrete(1, None)
flt2 = FilterDiscrete(1, None)
flt3 = FilterDiscrete(2, None)
self.assertEqual(flt1, flt2)
self.assertEqual(flt1.__dict__ == flt2.__dict__, flt1 == flt2)
self.assertNotEqual(flt1, flt3)
self.assertEqual(flt1.__dict__ == flt3.__dict__, flt1 == flt3)


class TestFilterString(unittest.TestCase):
Expand Down