# Path: shiori/bookmark/agents/feed_parser.py
# def get_updated(etree, nsmap):
# def get_title(etree, namespace):
# def get_link(etree, namespace):
# def get_items(etree, namespace):
# def get_ns(nsmap, key=None):
#     def __init__(self, url):
#     def retrieve_items(self):
# class FeedParser(object):


import unittest
from httpretty import HTTPretty, httprettified
from defusedxml.lxml import RestrictedElement
from shiori.bookmark.agents import feed_parser
# -*- coding: utf-8 -*-


class FeedParserTests(unittest.TestCase):

    def test_retrieve_not_connect_server(self):
        with self.assertRaises(SystemExit) as e:
            parser = feed_parser.FeedParser('http://example.org/rss')
        self.assertEqual(1, e.exception.code)

    @httprettified
    def test_feedparser_not_expected_response(self):
        HTTPretty.register_uri(HTTPretty.GET,
                               'http://example.org/rss')
        with self.assertRaises(SystemExit) as e:

# Path: shiori/bookmark/agents/feed_parser.py
# def get_updated(etree, nsmap):
# def get_title(etree, namespace):
# def get_link(etree, namespace):
# def get_items(etree, namespace):
# def get_ns(nsmap, key=None):
#     def __init__(self, url):
#     def retrieve_items(self):
# class FeedParser(object):


# Path: shiori_tests/tests/test_feed_parser.py
import unittest
from httpretty import HTTPretty, httprettified
from defusedxml.lxml import RestrictedElement
from shiori.bookmark.agents import feed_parser

# -*- coding: utf-8 -*-


class FeedParserTests(unittest.TestCase):

    def test_retrieve_not_connect_server(self):
        with self.assertRaises(SystemExit) as e:
            parser = feed_parser.FeedParser('http://example.org/rss')
        self.assertEqual(1, e.exception.code)

    @httprettified
    def test_feedparser_not_expected_response(self):
        HTTPretty.register_uri(HTTPretty.GET,
                               'http://example.org/rss')
        with self.assertRaises(SystemExit) as e:

            parser = feed_parser.FeedParser('http://example.org/rss')