FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Server Development

 
 
LinkBack Thread Tools
 
Old 07-29-2011, 02:59 PM
Chris Lumens
 
Default Fix import errors in the unit tests.

---
tests/storage_test/devicelibs_test/edd_test.py | 4 ++--
tests/tsort_test.py | 22 +++++++++++-----------
2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/tests/storage_test/devicelibs_test/edd_test.py b/tests/storage_test/devicelibs_test/edd_test.py
index 427ff21..a996e42 100644
--- a/tests/storage_test/devicelibs_test/edd_test.py
+++ b/tests/storage_test/devicelibs_test/edd_test.py
@@ -104,11 +104,11 @@ class EddTestCase(mock.TestCase):
""" Test scenario when the 0x80 and 0x81 edd directories contain the
same data and give no way to distinguish among the two devices.
"""
- from storage.devicelibs import edd
+ from pyanaconda.storage.devicelibs import edd
edd.log = mock.Mock()
edd.collect_mbrs = mock.Mock(return_value={'sda' : '0x000ccb01',
'vda' : '0x0006aef1'})
- fs = EddTestFS(edd).sda_sdb_same()
+ fs = EddTestFS(self, edd).sda_sdb_same()
self.assertEqual(edd.get_edd_dict([]), {})
self.assertIn((('edd: both edd entries 0x80 and 0x81 seem to map to sda',), {}),
edd.log.info.call_args_list)
diff --git a/tests/tsort_test.py b/tests/tsort_test.py
index 7547291..d16ee76 100644
--- a/tests/tsort_test.py
+++ b/tests/tsort_test.py
@@ -1,33 +1,33 @@

import unittest
-import tsort
+import pyanaconda.tsort

class TopologicalSortTestCase(unittest.TestCase):
def runTest(self):
items = [1, 2, 3, 4, 5]
edges = [(5, 4), (4, 3), (3, 2), (2, 1)]
- graph = tsort.create_graph(items, edges)
+ graph = pyanaconda.tsort.create_graph(items, edges)
self._tsortTest(graph)

edges = [(5, 4), (2, 3), (1, 5)]
- graph = tsort.create_graph(items, edges)
+ graph = pyanaconda.tsort.create_graph(items, edges)
self._tsortTest(graph)

edges = [(5, 4), (4, 3), (3, 2), (2, 1), (3, 5)]
- graph = tsort.create_graph(items, edges)
- self.failUnlessRaises(tsort.CyclicGraphError,
- tsort.tsort,
+ graph = pyanaconda.tsort.create_graph(items, edges)
+ self.failUnlessRaises(pyanaconda.tsort.CyclicGraph Error,
+ pyanaconda.tsort.tsort,
graph)

edges = [(5, 4), (4, 3), (3, 2), (2, 1), (2, 3)]
- graph = tsort.create_graph(items, edges)
- self.failUnlessRaises(tsort.CyclicGraphError,
- tsort.tsort,
+ graph = pyanaconda.tsort.create_graph(items, edges)
+ self.failUnlessRaises(pyanaconda.tsort.CyclicGraph Error,
+ pyanaconda.tsort.tsort,
graph)

items = ['a', 'b', 'c', 'd']
edges = [('a', 'c'), ('c', 'b')]
- graph = tsort.create_graph(items, edges)
+ graph = pyanaconda.tsort.create_graph(items, edges)
self._tsortTest(graph)

def _tsortTest(self, graph):
@@ -40,7 +40,7 @@ class TopologicalSortTestCase(unittest.TestCase):
return True

try:
- order = tsort.tsort(graph)
+ order = pyanaconda.tsort.tsort(graph)
except Exception as e:
self.fail(e)

--
1.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-01-2011, 06:15 AM
Ales Kozumplik
 
Default Fix import errors in the unit tests.

On 07/29/2011 04:59 PM, Chris Lumens wrote:

---
tests/storage_test/devicelibs_test/edd_test.py | 4 ++--
tests/tsort_test.py | 22 +++++++++++-----------
2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/tests/storage_test/devicelibs_test/edd_test.py b/tests/storage_test/devicelibs_test/edd_test.py
index 427ff21..a996e42 100644
--- a/tests/storage_test/devicelibs_test/edd_test.py
+++ b/tests/storage_test/devicelibs_test/edd_test.py
@@ -104,11 +104,11 @@ class EddTestCase(mock.TestCase):
""" Test scenario when the 0x80 and 0x81 edd directories contain the
same data and give no way to distinguish among the two devices.
"""
- from storage.devicelibs import edd
+ from pyanaconda.storage.devicelibs import edd
edd.log = mock.Mock()
edd.collect_mbrs = mock.Mock(return_value={'sda' : '0x000ccb01',
'vda' : '0x0006aef1'})
- fs = EddTestFS(edd).sda_sdb_same()
+ fs = EddTestFS(self, edd).sda_sdb_same()
self.assertEqual(edd.get_edd_dict([]), {})
self.assertIn((('edd: both edd entries 0x80 and 0x81 seem to map to sda',), {}),
edd.log.info.call_args_list)


An inexpertly executed merge on my part, thanks for fixing this.

Ales

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 03:57 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org