Repository: wireservice/agate

Issue:
agate.All cannot test whether all data is False
If the column data type is boolean, test gets overwritten to search for True values.


Discussion:

Patch:
diff --git a/agate/aggregations/any.py b/agate/aggregations/any.py
index 70fa702..67a9651 100644
--- a/agate/aggregations/any.py
+++ b/agate/aggregations/any.py
@@ -32,7 +32,7 @@ class Any(Aggregation):
         column = table.columns[self._column_name]
         data = column.values()
 
-        if isinstance(column.data_type, Boolean):
+        if isinstance(column.data_type, Boolean) and self._test is None:
             return any(data)
 
         return any(self._test(d) for d in data)


Test patch:
diff --git a/tests/test_aggregations.py b/tests/test_aggregations.py
index c3c8fbb..11eefe1 100644
--- a/tests/test_aggregations.py
+++ b/tests/test_aggregations.py
@@ -138,6 +138,7 @@ class TestBooleanAggregation(unittest.TestCase):
         table = Table(rows, ['test'], [Boolean()])
         Any('test').validate(table)
         self.assertEqual(Any('test').run(table), False)
+        self.assertEqual(Any('test', lambda r: not r).run(table), True)
 
     def test_all(self):
         rows = [