How to use the castero.feeds.Feeds function in castero

To help you get started, we’ve selected a few castero examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xgi / castero / tests / test_feeds.py View on Github external
def test_feeds_write(prevent_modification):
    copyfile(my_dir + "/datafiles/feeds_working", feeds.Feeds.PATH)
    myfeeds = feeds.Feeds()
    myfeed_path = my_dir + "/feeds/valid_basic.xml"
    myfeed = Feed(file=myfeed_path)
    myfeeds[myfeed_path] = myfeed
    myfeeds.write()
    myfeeds2 = feeds.Feeds()
    assert myfeed_path in myfeeds2
github xgi / castero / tests / test_feeds.py View on Github external
def test_feeds_del_item(prevent_modification):
    copyfile(my_dir + "/datafiles/feeds_working", feeds.Feeds.PATH)
    myfeeds = feeds.Feeds()
    del myfeeds["feed key"]
    assert "seek_distance" not in myfeeds
github xgi / castero / tests / test_feeds.py View on Github external
def test_feeds_at_1(prevent_modification):
    copyfile(my_dir + "/datafiles/feeds_working", feeds.Feeds.PATH)
    myfeeds = feeds.Feeds()
    assert myfeeds.at(1).title == "feed2 title"
github xgi / castero / tests / test_feeds.py View on Github external
def test_feeds_at_0(prevent_modification):
    copyfile(my_dir + "/datafiles/feeds_working", feeds.Feeds.PATH)
    myfeeds = feeds.Feeds()
    assert myfeeds.at(0).title == "feed title"
github xgi / castero / tests / test_feeds.py View on Github external
def test_feeds_default(prevent_modification):
    myfeeds = feeds.Feeds()
    assert isinstance(myfeeds, feeds.Feeds)
github xgi / castero / tests / test_feeds.py View on Github external
def test_feeds_reload(prevent_modification, display):
    os.chdir(my_dir)
    copyfile(my_dir + "/datafiles/feeds_working2", feeds.Feeds.PATH)
    myfeeds = feeds.Feeds()
    myfeeds2 = copy.copy(myfeeds)
    display.change_status = mock.MagicMock(name="change_status")
    myfeeds2.reload(display)
    assert display.change_status.call_count == 2
    for feed in myfeeds:
        assert feed in myfeeds2
github xgi / castero / tests / test_feeds.py View on Github external
def test_feeds_set_item(prevent_modification):
    myfeeds = feeds.Feeds()
    myfeeds["fake"] = "value"
    assert "fake" in myfeeds
github xgi / castero / tests / test_feeds.py View on Github external
def test_feeds_del_at_1(prevent_modification):
    copyfile(my_dir + "/datafiles/feeds_working", feeds.Feeds.PATH)
    myfeeds = feeds.Feeds()
    deleted = myfeeds.del_at(1)
    assert deleted
    assert "http://feed2_url" not in myfeeds
github xgi / castero / tests / test_feeds.py View on Github external
def test_feeds_write(prevent_modification):
    copyfile(my_dir + "/datafiles/feeds_working", feeds.Feeds.PATH)
    myfeeds = feeds.Feeds()
    myfeed_path = my_dir + "/feeds/valid_basic.xml"
    myfeed = Feed(file=myfeed_path)
    myfeeds[myfeed_path] = myfeed
    myfeeds.write()
    myfeeds2 = feeds.Feeds()
    assert myfeed_path in myfeeds2