From patchwork Fri Mar 11 19:29:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 596482 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id BDF721402C4 for ; Sat, 12 Mar 2016 06:29:46 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id A1B601A01BA for ; Sat, 12 Mar 2016 06:29:46 +1100 (AEDT) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lists.ozlabs.org (Postfix) with ESMTP id 03A541A00C8 for ; Sat, 12 Mar 2016 06:29:36 +1100 (AEDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 11 Mar 2016 11:29:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,321,1455004800"; d="scan'208";a="762521986" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga003.jf.intel.com with ESMTP; 11 Mar 2016 11:29:13 -0800 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 u2BJTCxG031660; Fri, 11 Mar 2016 19:29:12 GMT Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id u2BJTCA4009290; Fri, 11 Mar 2016 19:29:12 GMT Received: (from sfinucan@localhost) by sivswdev01.ir.intel.com with id u2BJTC5c009286; Fri, 11 Mar 2016 19:29:12 GMT From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH 2/3] tests: Add sanity test for HashField Date: Fri, 11 Mar 2016 19:29:10 +0000 Message-Id: <1457724551-9170-2-git-send-email-stephen.finucane@intel.com> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1457724551-9170-1-git-send-email-stephen.finucane@intel.com> References: <1457724551-9170-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 --- 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..3020332 --- /dev/null +++ b/patchwork/tests/test_fields.py @@ -0,0 +1,33 @@ +# Patchwork - automated patch tracking system +# Copyright (C) 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)