[tracker/rss-enclosures] functional-tests: some doc for the ontology-changes test template
- From: Roberto Guido <rguido src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/rss-enclosures] functional-tests: some doc for the ontology-changes test template
- Date: Wed, 24 Nov 2010 02:05:17 +0000 (UTC)
commit 20c366a245ad8a8a5ba0566cd5629a121289b78f
Author: Ivan Frade <ivan frade nokia com>
Date: Wed Oct 20 11:39:41 2010 +0300
functional-tests: some doc for the ontology-changes test template
tests/functional-tests/17-ontology-changes.py | 21 ++++++++++++++++-----
1 files changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/tests/functional-tests/17-ontology-changes.py b/tests/functional-tests/17-ontology-changes.py
index 2373765..d73949f 100755
--- a/tests/functional-tests/17-ontology-changes.py
+++ b/tests/functional-tests/17-ontology-changes.py
@@ -45,9 +45,18 @@ import re
import time
class OntologyChangeTestTemplate (ut.TestCase):
-
- def tearDown (self):
- print "*******"
+ """
+ Template class for the ontology changes tests. The tests are subclasses
+ of this, implementing these methods:
+
+ * set_ontology_dirs
+ * insert_data
+ * validate_status
+
+ and adding a method 'test_x_y_z' to be invoked by unittest.
+
+ Check doc in those methods for the specific details.
+ """
def get_ontology_dir (self, param):
local = os.path.join (os.getcwd (), "test-ontologies", param)
@@ -133,7 +142,10 @@ class OntologyChangeTestTemplate (ut.TestCase):
return
def __assert_ontology_dates (self, first_dir, second_dir):
-
+ """
+ Asserts that 91-test.ontology in second_dir has a more recent
+ modification time than in first_dir
+ """
ISO9601_REGEX = "(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z)"
def get_ontology_date (ontology):
@@ -149,7 +161,6 @@ class OntologyChangeTestTemplate (ut.TestCase):
print "something funky in", line
break
-
first_date = get_ontology_date (os.path.join (first_dir, "91-test.ontology"))
second_date = get_ontology_date (os.path.join (second_dir, "91-test.ontology"))
if first_date >= second_date:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]