def test_create_node_failed(self): self.mock_api_client(200) self.mock_node_create({}, 500) publisher = MarketingSitePublisher() publish_data = publisher._get_node_data(self.program, self.user_id) # pylint: disable=protected-access with self.assertRaises(ProgramPublisherException): publisher._create_node(self.api_client, publish_data) # pylint: disable=protected-access
def test_create_node(self): self.mock_api_client(200) self.mock_node_create(self.expected_node, 201) publisher = MarketingSitePublisher() publish_data = publisher._get_node_data(self.program, self.user_id) # pylint: disable=protected-access data = publisher._create_node(self.api_client, publish_data) # pylint: disable=protected-access self.assertEqual(data, self.expected_node['id'])
def test_create_node(self): self.mock_api_client(200) expected = {'list': [{'nid': self.nid}]} self.mock_node_create(expected, 201) publisher = MarketingSitePublisher() publish_data = publisher._get_node_data(self.program, self.user_id) # pylint: disable=protected-access data = publisher._create_node(self.api_client, publish_data) # pylint: disable=protected-access self.assertEqual(data, expected)
def test_create_node(self): self.mock_api_client(200) expected = { 'list': [{ 'nid': self.nid }] } self.mock_node_create(expected, 201) publisher = MarketingSitePublisher() publish_data = publisher._get_node_data(self.program, self.user_id) # pylint: disable=protected-access data = publisher._create_node(self.api_client, publish_data) # pylint: disable=protected-access self.assertEqual(data, expected)