def test_updates(self): token = 'abc123' comment = 'hello' flags = [{'name': 'awesome', 'status': '+'}] values = {'blocking': 'v1'} bug_data = {'update_token': token} updates = subject.create_updates(bug_data, comment=comment, flags=flags, values=values) expected = { 'token': token, 'comments': [{'text': comment}], 'flags': flags, 'blocking': 'v1' } self.assertEqual(expected, updates)
def test_invalid_call(self): with self.assertRaises(AssertionError): subject.create_updates('i am a string')
def test_no_updates(self): token = 'abc123' bug_data = {'update_token': token} updates = subject.create_updates(bug_data) self.assertEqual({'token': token}, updates)