Esempio n. 1
0
 def test_call_success_posts_to_callback_url(self):
     callback.call_success(self.fixture)
     postdata = {"applied_hash": callback.hash_deployment_config(self.fixture)}
     self.mock_post.assert_called_once_with(
         self.fixture["callback_url"],
         data=postdata,
         headers={'User-Agent': 'nodeconfig/callback for appname1'},
         verify=True)
Esempio n. 2
0
 def test_call_success_raises_exception_if_post_fails(self):
     self.mock_response.status_code = 404
     with self.assertRaises(Exception):
         callback.call_success(self.fixture)
Esempio n. 3
0
 def test_call_success_hashes_nodeconfig_to_create_hash(self):
     mock_hash = self.setUpPatch('hypernode.nodeconfig.callback.hash_deployment_config')
     callback.call_success(self.fixture)
     mock_hash.assert_called_with(self.fixture)
Esempio n. 4
0
 def test_call_success_checks_callback_url_var(self):
     callback.call_success(self.fixture)
     self.mock_checkvars.assert_called_once_with(self.fixture, ["callback_url", "app_name"])