diff options
author | Tim Jenssen <tim.jenssen@nokia.com> | 2011-03-08 20:46:27 +0100 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@nokia.com> | 2011-03-09 11:05:24 +0100 |
commit | 64391c88c7e1421dd146b528c4395c68049c4adb (patch) | |
tree | a9aca3608c546b134ad6d7d2ea8d164d0b008af0 /tests/test-framework/vmware/source.py | |
parent | 76122d63eced0b083e3c2e701c069aa2a8db360f (diff) |
moved some directories and adjusted the README
- also removed some unused projects under examples(updater, updaterplugin)
- adjusted pro files to the new structure
Diffstat (limited to 'tests/test-framework/vmware/source.py')
-rw-r--r-- | tests/test-framework/vmware/source.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/test-framework/vmware/source.py b/tests/test-framework/vmware/source.py new file mode 100644 index 000000000..fe067ab4e --- /dev/null +++ b/tests/test-framework/vmware/source.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +import os, time + +class Installer: + def __init__( self, path, platform, location, timestamp=None, tempfile=None ): + self.path = path + self.platform = platform + self.error = None + self.timestamp = timestamp + self.tempfile = tempfile + self.sourceLocation = location + + def markAsTested( self ): + self.sourceLocation.markAsTested( self.sourceFilename ) + +class Source: + def __init__( self ): + self._dummies = [] + + def nextInstaller( self ): + if len( self._dummies ) == 0: + return None + delay, path = self._dummies.pop() + time.sleep( delay ) + if os.path.exists( path ): + inst = Installer( path, "linux", None ) + inst.sourceFilename = path + return inst + else: + inst = Installer( None, None ) + #simulating download errors + inst.error = "Installer '{0}' does not exist".format( path ) + return inst + + def addDummy( self, delay, path ): + self._dummies.insert( 0, ( delay, path ) ) |