#!/usr/bin/python
import zephyr
import unittest
class NoticeTestCase(unittest.TestCase):
def test_init(self):
z = zephyr.Notice(zephyr.UNSAFE, "none", "eichin", "test", "", "eichin", "", "%s")
# auth may still be wrong, and message too
# z = zephyr.Notice()
class ZephyrTestCase(unittest.TestCase):
def chk_global(self, s):
self.failUnless(hasattr(zephyr,s), "missing %s" % s)
def test_globals(self):
self.chk_global("HM_SVCNAME")
self.chk_global("HM_SRV_SVCNAME")
self.chk_global("SERVER_SVCNAME")
self.chk_global("SERVER_INSTANCE")
self.chk_global("SERVER_SERVICE")
self.chk_global("ZAUTH_FAILED")
self.chk_global("ZAUTH_YES")
self.chk_global("ZAUTH_NO")
self.chk_global("UNSAFE")
self.chk_global("UNACKED")
self.chk_global("ACKED")
self.chk_global("HMACK")
self.chk_global("HMCTL")
self.chk_global("SERVACK")
self.chk_global("SERVNAK")
self.chk_global("CLIENTACK")
self.chk_global("STAT")
self.chk_global("ZERR_PKTLEN")
self.chk_global("ZERR_HEADERLEN")
self.chk_global("ZERR_ILLVAL")
self.chk_global("ZERR_HMPORT")
self.chk_global("ZERR_PORTINUSE")
self.chk_global("ZERR_BADPKT")
self.chk_global("ZERR_VERS")
self.chk_global("ZERR_NOPORT")
self.chk_global("ZERR_NONOTICE")
self.chk_global("ZERR_QLEN")
self.chk_global("ZERR_HMDEAD")
self.chk_global("ZERR_INTERNAL")
self.chk_global("ZERR_NOLOCATIONS")
self.chk_global("ZERR_NOMORELOCS")
self.chk_global("ZERR_FIELDLEN")
self.chk_global("ZERR_BADFIELD")
self.chk_global("ZERR_SERVNAK")
self.chk_global("ZERR_AUTHFAIL")
self.chk_global("ZERR_LOGINFAIL")
self.chk_global("ZERR_NOSUBSCRIPTIONS")
self.chk_global("ZERR_NOMORESUBSCRIPTIONS")
self.chk_global("ZERR_TOOMANYSUBS")
self.chk_global("ZERR_EOF")
self.chk_global("ERROR_TABLE_BASE_zeph")
if __name__ == '__main__':
unittest.main()