'Test to insure that Infinity -Infinity and NaN are supported by the python driver.
@since 3.0.0
@jira_ticket PYTHON-282
@expected_result nan, inf and -inf can be inserted and selected correctly.
@test_category data_types'

@notprotocolv1
def test_special_float_cql_encoding(self):

    s = self.session
    s.execute('\n                                                CREATE    TABLE    float_cql_encoding    (\n                                                                f    float    PRIMARY    KEY,\n                                                                d    double\n                                                )')
    items = (float('nan'), float('inf'), float('-inf'))
    def verify_insert_select(ins_statement, sel_statement):
        execute_concurrent_with_args(s, ins_statement, ((f, f) for f in items))
        for f in items:
            row = s.execute(sel_statement, (f,))[0]
            if math.isnan(f):
                self.assertTrue(math.isnan(row.f))
                self.assertTrue(math.isnan(row.d))
            else:
                self.assertEqual(row.f, f)
                self.assertEqual(row.d, f)
    verify_insert_select('INSERT    INTO    float_cql_encoding    (f,    d)    VALUES    (%s,    %s)', 'SELECT    *    FROM    float_cql_encoding    WHERE    f=%s')
    s.execute('TRUNCATE    float_cql_encoding')
    verify_insert_select(s.prepare('INSERT    INTO    float_cql_encoding    (f,    d)    VALUES    (?,    ?)'), s.prepare('SELECT    *    FROM    float_cql_encoding    WHERE    f=?'))
