diff --git a/test/features/container_limit.py b/test/features/container_limit.py
index 4a7da60..beed0c5 100644
--- a/test/features/container_limit.py
+++ b/test/features/container_limit.py
@@ -10,63 +10,63 @@
 
 # TODO: generate from ThriftTest.thrift
 def test_list(proto, value):
-  method_name = 'testList'
-  ttype = TType.LIST
-  etype = TType.I32
-  proto.writeMessageBegin(method_name, TMessageType.CALL, 3)
-  proto.writeStructBegin(method_name + '_args')
-  proto.writeFieldBegin('thing', ttype, 1)
-  proto.writeListBegin(etype, len(value))
-  for e in value:
-    proto.writeI32(e)
-  proto.writeListEnd()
-  proto.writeFieldEnd()
-  proto.writeFieldStop()
-  proto.writeStructEnd()
-  proto.writeMessageEnd()
-  proto.trans.flush()
+    method_name = 'testList'
+    ttype = TType.LIST
+    etype = TType.I32
+    proto.writeMessageBegin(method_name, TMessageType.CALL, 3)
+    proto.writeStructBegin(method_name + '_args')
+    proto.writeFieldBegin('thing', ttype, 1)
+    proto.writeListBegin(etype, len(value))
+    for e in value:
+        proto.writeI32(e)
+    proto.writeListEnd()
+    proto.writeFieldEnd()
+    proto.writeFieldStop()
+    proto.writeStructEnd()
+    proto.writeMessageEnd()
+    proto.trans.flush()
 
-  _, mtype, _ = proto.readMessageBegin()
-  assert mtype == TMessageType.REPLY
-  proto.readStructBegin()
-  _, ftype, fid = proto.readFieldBegin()
-  assert fid == 0
-  assert ftype == ttype
-  etype2, len2 = proto.readListBegin()
-  assert etype == etype2
-  assert len2 == len(value)
-  for i in range(len2):
-    v = proto.readI32()
-    assert v == value[i]
-  proto.readListEnd()
-  proto.readFieldEnd()
-  _, ftype, _ = proto.readFieldBegin()
-  assert ftype == TType.STOP
-  proto.readStructEnd()
-  proto.readMessageEnd()
+    _, mtype, _ = proto.readMessageBegin()
+    assert mtype == TMessageType.REPLY
+    proto.readStructBegin()
+    _, ftype, fid = proto.readFieldBegin()
+    assert fid == 0
+    assert ftype == ttype
+    etype2, len2 = proto.readListBegin()
+    assert etype == etype2
+    assert len2 == len(value)
+    for i in range(len2):
+        v = proto.readI32()
+        assert v == value[i]
+    proto.readListEnd()
+    proto.readFieldEnd()
+    _, ftype, _ = proto.readFieldBegin()
+    assert ftype == TType.STOP
+    proto.readStructEnd()
+    proto.readMessageEnd()
 
 
 def main(argv):
-  p = argparse.ArgumentParser()
-  add_common_args(p)
-  p.add_argument('--limit', type=int)
-  args = p.parse_args()
-  proto = init_protocol(args)
-  # TODO: test set and map
-  test_list(proto, list(range(args.limit - 1)))
-  test_list(proto, list(range(args.limit - 1)))
-  print('[OK]: limit - 1')
-  test_list(proto, list(range(args.limit)))
-  test_list(proto, list(range(args.limit)))
-  print('[OK]: just limit')
-  try:
-    test_list(proto, list(range(args.limit + 1)))
-  except:
-    print('[OK]: limit + 1')
-  else:
-    print('[ERROR]: limit + 1')
-    assert False
+    p = argparse.ArgumentParser()
+    add_common_args(p)
+    p.add_argument('--limit', type=int)
+    args = p.parse_args()
+    proto = init_protocol(args)
+    # TODO: test set and map
+    test_list(proto, list(range(args.limit - 1)))
+    test_list(proto, list(range(args.limit - 1)))
+    print('[OK]: limit - 1')
+    test_list(proto, list(range(args.limit)))
+    test_list(proto, list(range(args.limit)))
+    print('[OK]: just limit')
+    try:
+        test_list(proto, list(range(args.limit + 1)))
+    except:
+        print('[OK]: limit + 1')
+    else:
+        print('[ERROR]: limit + 1')
+        assert False
 
 
 if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
+    sys.exit(main(sys.argv[1:]))
