Skip to content

Commit 50ae7ac

Browse files
committed
New test cases which check that local copies of IPR disclosure files and WG descriptions exist
- Legacy-Id: 1823
1 parent 8075f36 commit 50ae7ac

2 files changed

Lines changed: 62 additions & 0 deletions

File tree

ietf/ipr/tests.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@
3030
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3131
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3232

33+
import os
3334
import unittest
3435
from django.test.client import Client
36+
from django.conf import settings
3537
from ietf.utils.test_utils import SimpleUrlTestCase, RealDatabaseTest
3638
import ietf.utils.test_runner as test_runner
3739

@@ -74,3 +76,16 @@ def testNewSpecific(self):
7476
print "OK (1 email found in test outbox)"
7577

7678

79+
class IprFileTestCase(unittest.TestCase):
80+
def testFileExistence(self):
81+
print "Testing if IPR disclosure files exist locally"
82+
fpath = os.path.join(settings.IPR_DOCUMENT_PATH, "juniper-ipr-RFC-4875.txt")
83+
if not os.path.exists(fpath):
84+
print "\nERROR: IPR disclosure files not found in "+settings.IPR_DOCUMENT_PATH
85+
print "They are needed for testing IPR searching."
86+
print "Download them to a local directory with:"
87+
print "wget -nd -nc -np -r ftp://ftp.ietf.org/ietf/IPR/"
88+
print "And set IPR_DOCUMENT_PATH in settings_local.py\n"
89+
else:
90+
print "OK (they seem to exist)"
91+

ietf/wginfo/tests.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,53 @@
1+
# Portions Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
2+
# All rights reserved. Contact: Pasi Eronen <pasi.eronen@nokia.com>
3+
#
4+
# Redistribution and use in source and binary forms, with or without
5+
# modification, are permitted provided that the following conditions
6+
# are met:
7+
#
8+
# * Redistributions of source code must retain the above copyright
9+
# notice, this list of conditions and the following disclaimer.
10+
#
11+
# * Redistributions in binary form must reproduce the above
12+
# copyright notice, this list of conditions and the following
13+
# disclaimer in the documentation and/or other materials provided
14+
# with the distribution.
15+
#
16+
# * Neither the name of the Nokia Corporation and/or its
17+
# subsidiary(-ies) nor the names of its contributors may be used
18+
# to endorse or promote products derived from this software
19+
# without specific prior written permission.
20+
#
21+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
132

33+
import os
34+
import unittest
35+
from django.conf import settings
236
from ietf.utils.test_utils import SimpleUrlTestCase
337

438
class WgInfoUrlTestCase(SimpleUrlTestCase):
539
def testUrls(self):
640
self.doTestUrls(__file__)
41+
42+
class WgFileTestCase(unittest.TestCase):
43+
def testFileExistence(self):
44+
print "Testing if WG charter files exist locally"
45+
fpath = os.path.join(settings.IETFWG_DESCRIPTIONS_PATH, "tls.desc.txt")
46+
if not os.path.exists(fpath):
47+
print "\nERROR: charter files not found in "+settings.IETFWG_DESCRIPTIONS_PATH
48+
print "They are needed for testing WG charter pages."
49+
print "(you can't currently download them, but we're working on this.)"
50+
print "And set IETFWG_DESCRIPTIONS_PATH in settings_local.py\n"
51+
else:
52+
print "OK (they seem to exist)"
53+

0 commit comments

Comments
 (0)