Skip to content

Commit

Permalink
Merge pull request #1784 from VesnaT/filter_test
Browse files Browse the repository at this point in the history
[FIX] Filter: Fix FilterContinuous eq operator
  • Loading branch information
lanzagar authored Dec 1, 2016
2 parents 378a902 + 1d977a2 commit 4975a33
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
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

0 comments on commit 4975a33

Please sign in to comment.