-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #118 from mulkieran/master-hawkey
Master hawkey
- Loading branch information
Showing
4 changed files
with
62 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/python | ||
import unittest | ||
|
||
import blivet.tasks.task as task | ||
import blivet.tasks.availability as availability | ||
|
||
class BasicUnavailableApplication(task.BasicApplication): | ||
ext = availability.unavailable_resource("unavailable") | ||
description = "unavailable application" | ||
|
||
def doTask(self): | ||
pass | ||
|
||
class BasicAvailableApplication(task.BasicApplication): | ||
ext = availability.available_resource("available") | ||
description = "available application" | ||
|
||
def doTask(self): | ||
pass | ||
|
||
class ResourceTestCase(unittest.TestCase): | ||
|
||
def testAvailabililty(self): | ||
unavailable_resource = availability.unavailable_resource("unavailable") | ||
self.assertNotEqual(unavailable_resource.availabilityErrors, []) | ||
self.assertFalse(unavailable_resource.available) | ||
|
||
available_resource = availability.available_resource("available") | ||
self.assertEqual(available_resource.availabilityErrors, []) | ||
self.assertTrue(available_resource.available) | ||
|
||
class TasksTestCase(unittest.TestCase): | ||
|
||
def testAvailability(self): | ||
unavailable_app = BasicUnavailableApplication() | ||
self.assertFalse(unavailable_app.available) | ||
self.assertNotEqual(unavailable_app.availabilityErrors, []) | ||
|
||
available_app = BasicAvailableApplication() | ||
self.assertTrue(available_app.available) | ||
self.assertEqual(available_app.availabilityErrors, []) |