def test_get(self): pc = PostController() post_id = pc.create(1, 'hello world') post = pc.get(1, post_id) self.assertIsInstance(post, ttypes.Post) self.assertEqual(post_id, post.id) post_id = pc.create(1, 'hello world') post = pc.get(1, post_id) self.assertIsInstance(post, ttypes.Post) self.assertEqual(post_id, post.id) # self.assertTrue(pc.get()) # def test_foo(self): # self.fail()
def test_create(self): pc = PostController() self.assertRaises(TypeError, pc.create, 'one', 'foo') self.assertEqual(1, pc.create(1, 'hello world')) self.assertEqual(2, pc.create(1, 'sample post'))