Unfugly-ing the wiki by taking the row arguments back out and placing them in the table params. Cleaned up some Python based on feedback from the resident Python expert.

This commit is contained in:
mike.morgan%oregonstate.edu 2006-09-09 09:57:22 +00:00
Родитель 25291320d7
Коммит 7eb0d83372
2 изменённых файлов: 59 добавлений и 49 удалений

Просмотреть файл

@ -4,8 +4,8 @@ which is copyright (c) 2002 Cunningham & Cunningham, Inc.
Released under the terms of the GNU General Public License version 2 or later.
"""
import urllib2
import feedparser # http://feedparser.org/
import urllib2
from fit.ColumnFixture import ColumnFixture
auth_handler = urllib2.HTTPBasicAuthHandler()
@ -36,7 +36,17 @@ class Verify(ColumnFixture):
"isMajorUpdate": "Boolean"}
def __init__(self):
super(Verify, self).__init__()
self.osVersion = "osVersion"
# Variables that are typically set in the FitNesse wiki params.
self.host = ""
self.product = ""
self.version = ""
self.platform = ""
self.locale = ""
# For storign the last retrieved AUS XML and its URI.
self.lastURI = ""
self.lastXML = ""
@ -54,11 +64,11 @@ class Verify(ColumnFixture):
# Check if the update type is "minor".
def isMinorUpdate(self):
return ("type=\"minor\"" in self.getXml())
return ('type="minor"' in self.getXml())
# Check if the update type is "major".
def isMajorUpdate(self):
return ("type=\"major\"" in self.getXml())
return ('type="major"' in self.getXml())
# Check if the AUS XML document is well-formed.
def isValidXml(self):
@ -82,11 +92,14 @@ class Verify(ColumnFixture):
# Builds an AUS URI based on our test data.
def buildUri(self):
return self.host + "/" + \
self.product + "/" + \
self.version + "/" + \
self.build + "/" + \
self.platform + "/" + \
self.locale + "/" + \
self.channel + "/" + \
self.osVersion + "/update.xml"
# Assign class variables from FitNesse arguments.
self.host = self.args[0]
self.product = self.args[1]
self.version = self.args[2]
self.platform = self.args[3]
self.locale = self.args[4]
return '/'.join((self.host, self.product, self.version, \
self.build, self.platform, self.locale, \
self.channel, self.osVersion, "update.xml"))

Просмотреть файл

@ -1,9 +1,6 @@
!1 Variables
!2 Environment
!define COMMAND_PATTERN {python %m -v %p}
!define TEST_RUNNER {/Users/morgamic/pyfit/fit/FitServer.py}
!2 Globals
!define host {http://khan.mozilla.org/~morgamic/austest/update/2}
!define product {Synthetic}
!define version {1.0}
@ -13,70 +10,70 @@
!1 Patches
1 only a complete
2 both complete and partial
|aus.Verify|
|host|product|version|build|platform|locale|channel|complete|partial|hasUpdate?|hasComplete?|hasPartial?|isValidXml?|
|${host}|${product}|${version}|1000000001|${platform}|${locale}|channel|complete001|partial001|true|true|false|true|
|${host}|${product}|${version}|1000000002|${platform}|${locale}|channel|complete002|partial002|true|true|true|true|
|aus.Verify|${host}|${product}|${version}|${platform}|${locale}|
|build|channel|complete|partial|hasUpdate?|hasComplete?|hasPartial?|isValidXml?|
|1000000001|channel|complete001|partial001|true|true|false|true|
|1000000002|channel|complete002|partial002|true|true|true|true|
!1 Invalid Input
1 no update is served for an invalid build id
|aus.Verify|
|host|product|version|build|platform|locale|channel|complete|partial|hasUpdate?|hasComplete?|hasPartial?|isValidXml?|
|${host}|${product}|${version}|0000000000|${platform}|${locale}|channel|complete|partial|false|false|false|true|
|aus.Verify|${host}|${product}|${version}|${platform}|${locale}|
|build|channel|complete|partial|hasUpdate?|hasComplete?|hasPartial?|isValidXml?|
|0000000000|channel|complete|partial|false|false|false|true|
!1 Channels and Fallback Channels
1 update exists for partner channel
2 update exists for normal channel
|aus.Verify|
|host|product|version|build|platform|locale|channel|complete|partial|hasUpdate?|hasComplete?|hasPartial?|isValidXml?|
|${host}|${product}|${version}|3000000001|${platform}|${locale}|channel-cck-partner|complete-partner-003|partial-partner-003|true|true|true|true|
|${host}|${product}|${version}|3000000001|${platform}|${locale}|channel|complete003|partial003|true|true|true|true|
|aus.Verify|${host}|${product}|${version}|${platform}|${locale}|
|build|channel|complete|partial|hasUpdate?|hasComplete?|hasPartial?|isValidXml?|
|3000000001|channel-cck-partner|complete-partner-003|partial-partner-003|true|true|true|true|
|3000000001|channel|complete003|partial003|true|true|true|true|
1 update for partner channel falls back and offers normal patches (complete|partial)004
2 update exists as expected for normal channel
|aus.Verify|
|host|product|version|build|platform|locale|channel|complete|partial|hasUpdate?|hasComplete?|hasPartial?|isValidXml?|
|${host}|${product}|${version}|4000000001|${platform}|${locale}|channel-cck-partner|complete004|partial004|true|true|true|true|
|${host}|${product}|${version}|4000000001|${platform}|${locale}|channel|complete004|partial004|true|true|true|true|
|aus.Verify|${host}|${product}|${version}|${platform}|${locale}|
|build|channel|complete|partial|hasUpdate?|hasComplete?|hasPartial?|isValidXml?|
|4000000001|channel-cck-partner|complete004|partial004|true|true|true|true|
|4000000001|channel|complete004|partial004|true|true|true|true|
1 update exists only on partner channel
2 update does not exist for normal channel
|aus.Verify|
|host|product|version|build|platform|locale|channel|complete|partial|hasUpdate?|hasComplete?|hasPartial?|isValidXml?|
|${host}|${product}|${version}|5000000001|${platform}|${locale}|channel-cck-partner|complete-partner-005|partial-partner-005|true|true|true|true|
|${host}|${product}|${version}|5000000001|${platform}|${locale}|channel|complete|partial|false|false|false|true|
|aus.Verify|${host}|${product}|${version}|${platform}|${locale}|
|build|channel|complete|partial|hasUpdate?|hasComplete?|hasPartial?|isValidXml?|
|5000000001|channel-cck-partner|complete-partner-005|partial-partner-005|true|true|true|true|
|5000000001|channel|complete|partial|false|false|false|true|
1 no update exists for partner channel
2 no update exists for normal channel
|aus.Verify|
|host|product|version|build|platform|locale|channel|complete|partial|hasUpdate?|hasComplete?|hasPartial?|isValidXml?|
|${host}|${product}|${version}|6000000001|${platform}|${locale}|channel-cck-partner|complete|partial|false|false|false|true|
|${host}|${product}|${version}|6000000001|${platform}|${locale}|channel|complete|partial|false|false|false|true|
|aus.Verify|${host}|${product}|${version}|${platform}|${locale}|
|build|channel|complete|partial|hasUpdate?|hasComplete?|hasPartial?|isValidXml?|
|6000000001|channel-cck-partner|complete|partial|false|false|false|true|
|6000000001|channel|complete|partial|false|false|false|true|
!1 Build ID Validation
1 don't serve update if build version in uri is newer than build version in *.txt
2 don't serve update if build version in uri is newer than build version in *.txt, fallback channel
|aus.Verify|
|host|product|version|build|platform|locale|channel|complete|partial|hasUpdate?|hasComplete?|hasPartial?|isValidXml?|
|${host}|${product}|${version}|7000000001|${platform}|${locale}|channel|complete|partial|false|false|false|true|
|${host}|${product}|${version}|7000000001|${platform}|${locale}|channel-cck-partner|complete|partial|false|false|false|true|
|aus.Verify|${host}|${product}|${version}|${platform}|${locale}|
|build|channel|complete|partial|hasUpdate?|hasComplete?|hasPartial?|isValidXml?|
|7000000001|channel|complete|partial|false|false|false|true|
|7000000001|channel-cck-partner|complete|partial|false|false|false|true|
!1 Major and Minor updates
1 minor update
2 major update
|aus.Verify|
|host|product|version|build|platform|locale|channel|complete|partial|hasUpdate?|isMinorUpdate?|isMajorUpdate?|hasComplete?|hasPartial?|isValidXml?|
|${host}|${product}|${version}|8000000001|${platform}|${locale}|channel|complete|partial|true|true|false|true|true|true|
|${host}|${product}|${version}|8000000002|${platform}|${locale}|channel|complete|partial|true|false|true|true|true|true|
|aus.Verify|${host}|${product}|${version}|${platform}|${locale}|
|build|channel|complete|partial|hasUpdate?|isMinorUpdate?|isMajorUpdate?|hasComplete?|hasPartial?|isValidXml?|
|8000000001|channel|complete|partial|true|true|false|true|true|true|
|8000000002|channel|complete|partial|true|false|true|true|true|true|
!1 os version compatibility
1 supported os version, or unknown os version
2 unsupported or blocked platform (exists in $unsupportedPlatforms in aus2 config)
|aus.Verify|
|host|product|version|build|platform|locale|channel|osVersion|complete|partial|hasUpdate?|hasComplete?|hasPartial?|isValidXml?|
|${host}|${product}|${version}|9000000001|${platform}|${locale}|channel|Web 2.0|complete|partial|true|true|true|true|
|${host}|${product}|${version}|9000000001|${platform}|${locale}|channel|Windows_98|complete|partial|false|false|false|true|
|aus.Verify|${host}|${product}|${version}|${platform}|${locale}|
|build|channel|complete|partial|osVersion|hasUpdate?|hasComplete?|hasPartial?|isValidXml?|
|9000000001|channel|complete|partial|Web 2.0|true|true|true|true|
|9000000001|channel|complete|partial|Windows_98|false|false|false|true|
!1 Nightly Updates
1 one-off update serving both complete and partial