summaryrefslogtreecommitdiffstats
path: root/tests/portage_news
diff options
context:
space:
mode:
authorAlec Warner <antarus@gentoo.org>2007-01-27 18:16:08 +0000
committerAlec Warner <antarus@gentoo.org>2007-01-27 18:16:08 +0000
commit6ac1f119472d2e41650f4cf7a9bdb17a3afda42c (patch)
treed993452f7ea513226b6fa4f6fd1ce130796a2914 /tests/portage_news
parent8a4a1ddb2255979e94ba5dd0148c4bbfd4920e57 (diff)
downloadportage-6ac1f119472d2e41650f4cf7a9bdb17a3afda42c.tar.gz
portage-6ac1f119472d2e41650f4cf7a9bdb17a3afda42c.tar.bz2
portage-6ac1f119472d2e41650f4cf7a9bdb17a3afda42c.zip
Move tests into new directory structure
svn path=/main/trunk/; revision=5794
Diffstat (limited to 'tests/portage_news')
-rw-r--r--tests/portage_news/__init__.py4
-rw-r--r--tests/portage_news/test_NewsItem.py83
2 files changed, 0 insertions, 87 deletions
diff --git a/tests/portage_news/__init__.py b/tests/portage_news/__init__.py
deleted file mode 100644
index aeaa49195..000000000
--- a/tests/portage_news/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-# tests/portage.news/__init__.py -- Portage Unit Test functionality
-# Copyright 2007 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
diff --git a/tests/portage_news/test_NewsItem.py b/tests/portage_news/test_NewsItem.py
deleted file mode 100644
index 22ef298d4..000000000
--- a/tests/portage_news/test_NewsItem.py
+++ /dev/null
@@ -1,83 +0,0 @@
-# test_NewsItem.py -- Portage Unit Testing Functionality
-# Copyright 2007 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: test_varExpand.py 5596 2007-01-12 08:08:53Z antarus $
-
-from unittest import TestCase, TestLoader
-from portage.news import NewsItem
-from portage.const import PROFILE_PATH
-
-class NewsItemTestCase(TestCase):
-
- self.fakeItem = """
-Title: YourSQL Upgrades from 4.0 to 4.1
-Author: Ciaran McCreesh <ciaranm@gentoo.org>
-Content-Type: text/plain
-Posted: 01-Nov-2005
-Revision: 1
-#Display-If-Installed:
-#Display-If-Profile:
-#Display-If-Arch:
-
-YourSQL databases created using YourSQL version 4.0 are incompatible
-with YourSQL version 4.1 or later. There is no reliable way to
-automate the database format conversion, so action from the system
-administrator is required before an upgrade can take place.
-
-Please see the Gentoo YourSQL Upgrade Guide for instructions:
-
- http://www.gentoo.org/doc/en/yoursql-upgrading.xml
-
-Also see the official YourSQL documentation:
-
- http://dev.yoursql.com/doc/refman/4.1/en/upgrading-from-4-0.html
-
-After upgrading, you should also recompile any packages which link
-against YourSQL:
-
- revdep-rebuild --library=libyoursqlclient.so.12
-
-The revdep-rebuild tool is provided by app-portage/gentoolkit.
-"""
-
- from portage import settings
- import time
-
- def testDisplayIfProfile():
- from portage.const import PROFILE_PATH
- tmpItem = self.fakeItem.replace("#Display-If-Profile:", "Display-If-Profile: %s" %
- os.readlink( PROFILE_PATH ) )
-
- item = _processItem(tmpItem)
- self.assertTrue( item.isRelevant( os.readlink( PROFILE_PATH ) ),
- msg="Expected %s to be relevant, but it was not!" % tmpItem )
-
- def testDisplayIfInstalled():
- tmpItem = self.fakeItem.replace("#Display-If-Installed:", "Display-If-Profile: %s" %
- "sys-apps/portage" )
-
- item = _processItem(tmpItem)
- self.assertTrue( item.isRelevant( portage.settings ),
- msg="Expected %s to be relevant, but it was not!" % tmpItem )
-
-
- def testDisplayIfKeyword():
- from portage import settings
- tmpItem = self.fakeItem.replace("#Display-If-Keyword:", "Display-If-Keyword: %s" %
- settings["ACCEPT_KEYWORDS"].split()[0] )
-
- item = _processItem(tmpItem)
- self.assertTrue( item.isRelevant( os.readlink( PROFILE_PATH ) ),
- msg="Expected %s to be relevant, but it was not!" % tmpItem )
-
-
- def _processItem( self, item ):
-
- path = os.path.join( settings["PORTAGE_TMPDIR"], str(time.time())
- f = open( os.path.join( path )
- f.write(item)
- f.close
- try:
- return NewsItem( path, 0 )
- except TypeError:
- self.fail("Error while processing news item %s" % path )