aboutsummaryrefslogtreecommitdiffstats
path: root/previousAttempts/jython/purgeObsoleteTest.py
diff options
context:
space:
mode:
Diffstat (limited to 'previousAttempts/jython/purgeObsoleteTest.py')
-rw-r--r--previousAttempts/jython/purgeObsoleteTest.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/previousAttempts/jython/purgeObsoleteTest.py b/previousAttempts/jython/purgeObsoleteTest.py
new file mode 100644
index 0000000..c4d1ec9
--- /dev/null
+++ b/previousAttempts/jython/purgeObsoleteTest.py
@@ -0,0 +1,43 @@
+# -*- coding: utf-8 -*-
+from __future__ import division
+import unittest
+
+class SimpleDateTest(unittest.TestCase):
+ def setUp(self):
+ from purgeObsolete import SimpleDate
+
+ def runInnerTest(self):
+ threeMonthAgo = date.today()
+ JD3MAgo = GregorianCalendar(threeMonthAgo.year,
+ threeMonthAgo.month-1,
+ threeMonthAgo.day,0,0)
+ formatter = SimpleDateFormat("yyyy-MM-dd",Locale.US);
+ JD3MAgoStr = formatter.format(JD3MAgo.getTime())
+ self.assertEqual(str(threeMonthAgo),JD3MAgoStr)
+
+ def runTest(self):
+ pass
+
+class ArchivedStoreTest(unittest.TestCase):
+ def setUp(self):
+ from purgeObsolete import ArchivedStore
+ self.store = ArchivedStore(paramServer="zimbra")
+
+ def tearDown(self):
+ self.store.store.close()
+
+ def testConnect(self):
+ folderList = self.store.store.getDefaultFolder().list("*")
+ self.assertEqual(len(folderList)>0,True)
+
+ def testOpeningFolder(self):
+ from purgeObsolete import ArchivedFolder
+ folder = ArchivedFolder(self.store,"INBOX/bugzilla/xgl")
+ self.assertEqual(folder.folder.getMessageCount() > 0,True)
+
+ def runTest(self):
+ self.testConnect()
+ self.testOpeningFolder()
+
+if __name__=="__main__":
+ unittest.main()