From patchwork Tue Mar 15 11:27:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 597461 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qPXRL4tw2z9s48 for ; Tue, 15 Mar 2016 22:27:58 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3qPXRL48cdzDqyJ for ; Tue, 15 Mar 2016 22:27:58 +1100 (AEDT) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lists.ozlabs.org (Postfix) with ESMTP id 3qPXRF1HHSzDqgl for ; Tue, 15 Mar 2016 22:27:52 +1100 (AEDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 15 Mar 2016 04:27:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,338,1455004800"; d="scan'208";a="910913218" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga001.jf.intel.com with ESMTP; 15 Mar 2016 04:27:50 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u2FBRn4R017157; Tue, 15 Mar 2016 11:27:49 GMT Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id u2FBRnMJ020600; Tue, 15 Mar 2016 11:27:49 GMT Received: (from sfinucan@localhost) by sivswdev01.ir.intel.com with id u2FBRneK020596; Tue, 15 Mar 2016 11:27:49 GMT From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH v2 2/3] tests: Add sanity test for HashField Date: Tue, 15 Mar 2016 11:27:39 +0000 Message-Id: <1458041260-20548-2-git-send-email-stephen.finucane@intel.com> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1458041260-20548-1-git-send-email-stephen.finucane@intel.com> References: <1458041260-20548-1-git-send-email-stephen.finucane@intel.com> X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" Signed-off-by: Stephen Finucane Reviewed-by: Andy Doan --- patchwork/tests/test_fields.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 patchwork/tests/test_fields.py diff --git a/patchwork/tests/test_fields.py b/patchwork/tests/test_fields.py new file mode 100644 index 0000000..fbe1ab6 --- /dev/null +++ b/patchwork/tests/test_fields.py @@ -0,0 +1,33 @@ +# Patchwork - automated patch tracking system +# Copyright (C) 2016 Intel Corporation +# +# This file is part of the Patchwork package. +# +# Patchwork is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# Patchwork is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Patchwork; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +from django.test import SimpleTestCase + +from patchwork import fields + + +class TestHashField(SimpleTestCase): + + def test_n_bytes(self): + """Sanity check the hashing algorithm. + + Changing this can change our database schema. + """ + field = fields.HashField() + self.assertEqual(field.n_bytes, 40)