Ejemplo n.º 1
0
    def test__coerce_value_exception(self):
        """Test coercion failure that returns the original string."""

        expectation = "2015-03-12T00:12:55.500814+00:00"
        elasticfilter = ElasticFilter()

        # pylint: disable=W0212
        result = elasticfilter._coerce_value(expectation)
        self.assertEqual(result, expectation)
Ejemplo n.º 2
0
    def test__coerce_value_exception(self):
        """Test coercion failure that returns the original string."""

        expectation = '2015-03-12T00:12:55.500814+00:00'
        elasticfilter = ElasticFilter()

        # pylint: disable=W0212
        result = elasticfilter._coerce_value(expectation)
        self.assertEqual(result, expectation)
Ejemplo n.º 3
0
    def test__coerce_value_list(self):
        """Test that we properly coerce values to native python types."""

        expectation = [1426206062000, 1426206062000]
        quoted_value = "[1426206062000, 1426206062000]"
        elasticfilter = ElasticFilter()

        # pylint: disable=W0212
        result = elasticfilter._coerce_value(quoted_value)
        self.assertEqual(result, expectation)
Ejemplo n.º 4
0
    def test__coerce_value_list(self):
        """Test that we properly coerce values to native python types."""

        expectation = [1426206062000, 1426206062000]
        quoted_value = '[1426206062000, 1426206062000]'
        elasticfilter = ElasticFilter()

        # pylint: disable=W0212
        result = elasticfilter._coerce_value(quoted_value)
        self.assertEqual(result, expectation)