'Make sure default_serial_consistency_level passes through to a query message.
Also make sure Statement.serial_consistency_level overrides the default.
PR #510'

@mock_session_pools
def test_default_serial_consistency_level(self, *_):

    s = Session(Cluster(protocol_version=4), [Host('127.0.0.1', SimpleConvictionPolicy)])
    self.assertIsNone(s.default_serial_consistency_level)
    sentinel = 1001
    for cl in (None, ConsistencyLevel.LOCAL_SERIAL, ConsistencyLevel.SERIAL, sentinel):
        s.default_serial_consistency_level = cl
        f = s.execute_async(query='')
        self.assertEqual(f.message.serial_consistency_level, cl)
        for cl_override in (ConsistencyLevel.LOCAL_SERIAL, ConsistencyLevel.SERIAL):
            f = s.execute_async(SimpleStatement(query_string='', serial_consistency_level=cl_override))
            self.assertEqual(s.default_serial_consistency_level, cl)
            self.assertEqual(f.message.serial_consistency_level, cl_override)
