示例#1
0
文件: test_mbx.py 项目: mattmb/spoke
 def test_get_mailbox(self):
     """Retrieve a mailbox; return a list of tuples."""
     flags = '\\HasNoChildren'
     expected_result = [(self.mbx_name, self.sep, flags)]
     mbx = SpokeMbx()
     result = mbx.get(self.mbx_name)
     self.assertEqual(expected_result, result)
示例#2
0
文件: test_mbx.py 项目: mattmb/spoke
 def test_delete_missing_mailbox(self):
     """Delete a missing mailbox; raise SpokeIMAPError."""
     mbx_name = '*****@*****.**'
     mbx = SpokeMbx()
     self.assertRaises(error.SpokeIMAPError, mbx.delete, mbx_name)
示例#3
0
文件: test_mbx.py 项目: mattmb/spoke
 def test_delete_mailbox(self):
     """Delete a mailbox; return True."""
     mbx_name = '*****@*****.**'
     mbx = SpokeMbx()
     mbx.create(mbx_name)
     self.assertTrue(mbx.delete(mbx_name))
示例#4
0
文件: test_mbx.py 项目: mattmb/spoke
 def test_input_nvalid_mailbox(self):
     """Retrieve an invalid mailbox; raise InputError."""
     mbx_name = '*@test.mailbox.loc'
     mbx = SpokeMbx()
     self.assertRaises(error.InputError, mbx.get, mbx_name)
示例#5
0
文件: test_mbx.py 项目: mattmb/spoke
 def test_create_mailbox_twice(self):
     """Create mailbox twice; raise SpokeIMAPError."""
     mbx = SpokeMbx()
     self.assertRaises(error.SpokeIMAPError, mbx.create, self.mbx_name)
示例#6
0
文件: test_mbx.py 项目: mattmb/spoke
 def tearDown(self):
     mbx = SpokeMbx()
     mbx.delete(self.mbx_name)
示例#7
0
文件: test_mbx.py 项目: mattmb/spoke
 def setUp(self):
     mbx = SpokeMbx()
     mbx.create(self.mbx_name)