incubator-bloodhound-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From and...@apache.org
Subject svn commit: r1448131 - in /incubator/bloodhound/trunk/bloodhound_search/bhsearch/tests: base.py search_resources/ticket_search.py
Date Wed, 20 Feb 2013 12:47:17 GMT
Author: andrej
Date: Wed Feb 20 12:47:16 2013
New Revision: 1448131

URL: http://svn.apache.org/r1448131
Log:
#403 prepare unit-test

Modified:
    incubator/bloodhound/trunk/bloodhound_search/bhsearch/tests/base.py
    incubator/bloodhound/trunk/bloodhound_search/bhsearch/tests/search_resources/ticket_search.py

Modified: incubator/bloodhound/trunk/bloodhound_search/bhsearch/tests/base.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_search/bhsearch/tests/base.py?rev=1448131&r1=1448130&r2=1448131&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_search/bhsearch/tests/base.py (original)
+++ incubator/bloodhound/trunk/bloodhound_search/bhsearch/tests/base.py Wed Feb 20 12:47:16
2013
@@ -93,7 +93,8 @@ class BaseBloodhoundSearchTest(unittest.
         milestone = self.create_milestone(
             name = name,
             description = description)
-        return milestone.insert()
+        milestone.insert()
+        return milestone
 
     def create_milestone(self, name, description = None):
         milestone = Milestone(self.env)

Modified: incubator/bloodhound/trunk/bloodhound_search/bhsearch/tests/search_resources/ticket_search.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_search/bhsearch/tests/search_resources/ticket_search.py?rev=1448131&r1=1448130&r2=1448131&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_search/bhsearch/tests/search_resources/ticket_search.py
(original)
+++ incubator/bloodhound/trunk/bloodhound_search/bhsearch/tests/search_resources/ticket_search.py
Wed Feb 20 12:47:16 2013
@@ -23,9 +23,9 @@ from bhsearch.api import BloodhoundSearc
 from bhsearch.tests.base import BaseBloodhoundSearchTest
 from bhsearch.search_resources.ticket_search import TicketIndexer
 
-class TicketIndexerSilenceOnExceptionTestCase(BaseBloodhoundSearchTest):
+class TicketIndexerTestCase(BaseBloodhoundSearchTest):
     def setUp(self):
-        super(TicketIndexerSilenceOnExceptionTestCase, self).setUp()
+        super(TicketIndexerTestCase, self).setUp()
         self.ticket_indexer = TicketIndexer(self.env)
         self.search_api = BloodhoundSearchApi(self.env)
         self.env.config.set('bhsearch', 'silence_on_error', "False")
@@ -53,9 +53,24 @@ class TicketIndexerSilenceOnExceptionTes
         self.assertEqual(1, results.hits)
         self.assertEqual("Header", results.docs[0]["content"])
 
+    @unittest.skip("TODO")
+    def test_can_reflect_milestone_renaming(self):
+        #act
+        INITIAL_MILESTONE = "initial_milestone"
+        RENAMED_MILESTONE = "renamed_name"
+        milestone = self.insert_milestone(INITIAL_MILESTONE)
+        self.insert_ticket("T1", milestone=INITIAL_MILESTONE)
+        milestone.name = RENAMED_MILESTONE
+        milestone.update()
+
+        #assert
+        results = self.search_api.query("type:ticket")
+        self.print_result(results)
+        self.assertEqual(1, results.hits)
+        self.assertEqual(RENAMED_MILESTONE, results.docs[0]["milestone"])
 
 def suite():
-    return unittest.makeSuite(TicketIndexerSilenceOnExceptionTestCase, 'test')
+    return unittest.makeSuite(TicketIndexerTestCase, 'test')
 
 if __name__ == '__main__':
     unittest.main()



Mime
View raw message