def test_filter(self):
        new_query = MagicMock(spec=ResolweQuery)
        query = MagicMock(spec=ResolweQuery, **{'_clone.return_value': new_query})

        result = ResolweQuery.filter(query, id=2)
        result._add_filter.assert_called_once_with({'id': 2})  # pylint: disable=no-member
        # make sure that original hasnt changed
        self.assertEqual(query._add_filter.call_count, 0)
Example #2
0
    def test_filter(self):
        new_query = MagicMock(spec=ResolweQuery)
        query = MagicMock(spec=ResolweQuery, **{"_clone.return_value": new_query})

        result = ResolweQuery.filter(query, id=2)
        result._add_filter.assert_called_once_with({"id": 2})
        # make sure that original hasnt changed
        self.assertEqual(query._add_filter.call_count, 0)
Example #3
0
    def test_filter(self):
        new_query = MagicMock(spec=ResolweQuery)
        query = MagicMock(spec=ResolweQuery,
                          **{'_clone.return_value': new_query})

        result = ResolweQuery.filter(query, id=2)
        result._add_filter.assert_called_once_with({'id': 2})  # pylint: disable=no-member
        # make sure that original hasnt changed
        self.assertEqual(query._add_filter.call_count, 0)