[pitivi] test_integration.py: check for duplicate source names in Configuration
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pitivi] test_integration.py: check for duplicate source names in Configuration
- Date: Fri, 20 Nov 2009 07:48:58 +0000 (UTC)
commit b3197cae30fbb1bb18906992c2f2085aba0a18c4
Author: Brandon Lewis <brandon_lewis alum berkeley edu>
Date: Wed Nov 11 09:35:06 2009 -0800
test_integration.py: check for duplicate source names in Configuration
tests/test_integration.py | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/tests/test_integration.py b/tests/test_integration.py
index 273a775..4ee4e62 100644
--- a/tests/test_integration.py
+++ b/tests/test_integration.py
@@ -116,14 +116,21 @@ class Configuration(object):
def __init__(self, *sources):
self.sources = []
+ self.source_map = {}
for source in sources:
self.addSource(*source)
def addSource(self, name, uri, props=None, error=False):
+ if name in self.source_map:
+ raise Exception("Duplicate source: '%d' already defined" % name)
self.sources.append((name, uri, props))
+ self.source_map[name] = uri, props
def addBadSource(self, name, uri):
+ if name in self.source_map:
+ raise Exception("Duplicate source: '%d' already defined" % name)
self.sources.append((name, uri))
+ self.source_map[name] = uri, None
def getUris(self):
return set((source[1] for source in self.sources))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]