summaryrefslogtreecommitdiff
path: root/test/DocTests.py
diff options
context:
space:
mode:
authorAlexis Hildebrandt <afh@surryhill.net>2015-02-20 23:09:26 +0100
committerAlexis Hildebrandt <afh@surryhill.net>2015-02-20 23:09:26 +0100
commit6f6d4ec26cf10d8e2af45b54efaf1b05272c1c02 (patch)
tree7eefa4b95b89c72f68392c5401a3db7a1e3e98c8 /test/DocTests.py
parentcad6bbd3865db9c023862656bd6fa3c5ee3bb1e5 (diff)
downloadfork-ledger-6f6d4ec26cf10d8e2af45b54efaf1b05272c1c02.tar.gz
fork-ledger-6f6d4ec26cf10d8e2af45b54efaf1b05272c1c02.tar.bz2
fork-ledger-6f6d4ec26cf10d8e2af45b54efaf1b05272c1c02.zip
[tests] Minor test/DocTests.py clean up
Diffstat (limited to 'test/DocTests.py')
-rwxr-xr-xtest/DocTests.py23
1 files changed, 7 insertions, 16 deletions
diff --git a/test/DocTests.py b/test/DocTests.py
index f5746ec4..ac681bc2 100755
--- a/test/DocTests.py
+++ b/test/DocTests.py
@@ -158,22 +158,13 @@ class DocTests:
failed.add(test_id)
continue
- try:
- output = example[self.testout_token][self.testout_token]
- except KeyError:
- output = None
-
- try:
- input = example[self.testdat_token][self.testdat_token]
- except KeyError:
- try:
- with_input = example[self.testin_token]['opts'][self.testwithdat_token]
- input = self.examples[with_input][self.testdat_token][self.testdat_token]
- except KeyError:
- try:
- input = example[self.validate_dat_token][self.validate_dat_token]
- except KeyError:
- input = None
+ output = example.get(self.testout_token, {}).get(self.testout_token)
+ input = example.get(self.testdat_token, {}).get(self.testdat_token)
+ if not input:
+ with_input = example.get(self.testin_token, {}).get('opts', {}).get(self.testwithdat_token)
+ input = self.examples.get(with_input, {}).get(self.testdat_token, {}).get(self.testdat_token)
+ if not input:
+ input = example.get(self.validate_dat_token, {}).get(self.validate_dat_token)
if command and (output != None or validation):
test_file_created = False