def test_server_template_info(self): template_href = account_url + 'account_id/ec2_server_templates/111' server_template = [{ 'href': template_href, 'nickname': 'spurious' }] self.response.content = json.dumps(server_template) response = righteous.server_template_info(template_href) self.assertEqual(response, server_template) self.request.assert_called_once_with('/server_templates/111.js')
def test_server_template_info_not_found(self): template_href = account_url + 'account_id/ec2_server_templates/111' self.response.content = '[]' response = righteous.server_template_info(template_href) self.assertEqual(response, None) self.request.assert_called_once_with('/server_templates/111.js')
def test_server_template_info(self): template_href = self._create_template() template = righteous.server_template_info(template_href) self.assertTrue(template) self.assertEqual(template['nickname'], self.template)
def test_server_template_info(self): template_href = self._create_template() template = righteous.server_template_info(template_href) assert template assert_equal(template['nickname'], self.template)