-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rough draft #2 of part of the bookmarks module.
Define a class of Bookmark, for an individual bookmark, and a class of BookmarkSet, as a set of bookmarks.
- Loading branch information
Showing
4 changed files
with
52 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
,FM,,O | ||
155000400,,,O | ||
155000300,TINCAN,This is a bad bookmark |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
import pytest | ||
import csv | ||
from rig_remote.bookmarks import Bookmarks | ||
from rig_remote.bookmarks import BookmarkSet | ||
from rig_remote.exceptions import InvalidBookmark | ||
import logging | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
def test_bookmark_load(): | ||
mybm = Bookmarks("./test/test-bookmark-file.csv") | ||
mybm = BookmarkSet("./test/test-bookmark-file.csv") | ||
mybm.load_from_file() | ||
|
||
def test_bookmark_load2(): | ||
mybm = BookmarkSet("./test/test-bad-bookmark-file.csv") | ||
with pytest.raises(InvalidBookmark): | ||
mybm.load_from_file() | ||
|
||
def test_bookmark_save(): | ||
mybm = Bookmarks("./test/test-bookmark-file.csv") | ||
mybm = BookmarkSet("./test/test-bookmark-file.csv") | ||
mybm.load_from_file() | ||
mybm.save_to_file() |