예제 #1
0
 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
예제 #2
0
 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
예제 #3
0
 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'])
예제 #4
0
 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)
예제 #5
0
 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)