SF.net SVN: gar:[23435] csw/mgar/gar/v2/lib/python/chkdbcat_test.py

guengel at users.sourceforge.net guengel at users.sourceforge.net
Sun Apr 20 13:54:25 CEST 2014


Revision: 23435
          http://sourceforge.net/p/gar/code/23435
Author:   guengel
Date:     2014-04-20 11:54:23 +0000 (Sun, 20 Apr 2014)
Log Message:
-----------
lib/python/chkdbcat_test.py: adjusted to test changes made in r23434.

Revision Links:
--------------
    http://sourceforge.net/p/gar/code/23434

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/python/chkdbcat_test.py

Modified: csw/mgar/gar/v2/lib/python/chkdbcat_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/chkdbcat_test.py	2014-04-20 11:52:43 UTC (rev 23434)
+++ csw/mgar/gar/v2/lib/python/chkdbcat_test.py	2014-04-20 11:54:23 UTC (rev 23435)
@@ -171,9 +171,53 @@
             with TimestampRecord(self.__tmpfile) as obj:
                   self.assertRaises(TypeError,obj.set,'unstable', 'i386', 'SunOS5.11', 1)
 
+      def test_Notified(self):
+            with TimestampRecord(self.__tmpfile) as obj:
+                  obj.set('unstable', 'i386', 'SunOS5.10',
+                          datetime.datetime.now().replace(microsecond=0))
+                  obj.notified('unstable', 'i386', 'SunOS5.10',
+                               'raos at opencsw.org')
+                  obj.notified('unstable', 'i386', 'SunOS5.10',
+                               'somebodyelse at opencsw.org')
+
+                  obj.set('unstable', 'sparc', 'SunOS5.10',
+                          datetime.datetime.now().replace(microsecond=0))
+                  obj.notified('unstable', 'sparc', 'SunOS5.10',
+                               '1 at opencsw.org')
+                  obj.notified('unstable', 'sparc', 'SunOS5.10',
+                               '2 at opencsw.org')
+
+                  self.assertTrue(obj.is_notified('unstable', 'i386',
+                                                  'SunOS5.10',
+                                                  'raos at opencsw.org'))
+                  self.assertTrue(obj.is_notified('unstable', 'i386',
+                                                  'SunOS5.10',
+                                                  'somebodyelse at opencsw.org'))
+                  self.assertTrue(obj.is_notified('unstable', 'sparc',
+                                                  'SunOS5.10',
+                                                  '1 at opencsw.org'))
+                  self.assertTrue(obj.is_notified('unstable', 'sparc',
+                                                  'SunOS5.10',
+                                                  '2 at opencsw.org'))
+
+            with TimestampRecord(self.__tmpfile) as obj:
+                  self.assertTrue(obj.is_notified('unstable', 'i386',
+                                                  'SunOS5.10',
+                                                  'raos at opencsw.org'))
+                  self.assertTrue(obj.is_notified('unstable', 'i386',
+                                                  'SunOS5.10',
+                                                  'somebodyelse at opencsw.org'))
+                  self.assertTrue(obj.is_notified('unstable', 'sparc',
+                                                  'SunOS5.10',
+                                                  '1 at opencsw.org'))
+                  self.assertTrue(obj.is_notified('unstable', 'sparc',
+                                                  'SunOS5.10',
+                                                  '2 at opencsw.org'))
+
       def tearDown(self):
             try:
-                  os.unlink(self.__tmpfile)
+                  #os.unlink(self.__tmpfile)
+                  pass
             except:
                   pass
 
@@ -241,7 +285,7 @@
                   }
             }
 
-            def notify(self, date, addr, pkginfo, chkcat_stdout, chkcat_stderr):
+            def notify_broken(self, date, addr, pkginfo, chkcat_stdout, chkcat_stderr):
                   assert date == self.expected_notification_on[addr]['lastsuccessful']
 
                   if addr == "raos at opencsw.org":
@@ -256,7 +300,7 @@
 
                   mail = InformMaintainer((self._catrel, self._osrel, self._arch),
                                           date, addr, pkginfo, chkcat_stdout, chkcat_stderr)
-                  print mail._compose_mail('TestScript')
+                  print mail._compose_mail_broken('TestScript')
 
 
       def setUp(self):

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list