Skip to content

Commit

Permalink
updated function names
Browse files Browse the repository at this point in the history
  • Loading branch information
paperboi committed Jun 25, 2021
1 parent f3bffb9 commit 8c2155e
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions tests/test_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from kindle2notion.parsing import (
parse_raw_clippings_text,
_parse_author_and_title,
_parse_page_location_and_date,
_parse_page_location_date_and_note,
_add_parsed_items_to_books_dict,
)
from kindle2notion.reading import read_raw_clippings
Expand Down Expand Up @@ -163,69 +163,69 @@ def test_parse_author_and_title_case_should_parse_the_author_and_title_when_ther
assert expected == actual


def test_parse_page_location_and_date_should_parse_the_page_location_and_date_when_there_are_all_three():
def test_parse_page_location_date_and_note_should_parse_the_page_location_and_date_when_there_are_all_three():
# Given
raw_clipping_list = [
"Relativity (Albert Einstein)",
"- Your Highlight on page 3 | Location 184-185 | Added on Friday, April 30, 2021 12:31:29 AM",
"",
"This is a test highlight.",
]
expected = ("3", "184-185", "Friday, 30 April 2021 12:31:29 AM")
expected = ("3", "184-185", "Friday, 30 April 2021 12:31:29 AM", False)

# When
actual = _parse_page_location_and_date(raw_clipping_list)
actual = _parse_page_location_date_and_note(raw_clipping_list)

# Then
assert expected == actual


def test_parse_page_location_and_date_should_parse_the_page_and_location_when_there_is_no_date():
def test_parse_page_location_date_and_note_should_parse_the_page_and_location_when_there_is_no_date():
# Given
raw_clipping_list = [
"Relativity (Albert Einstein)",
"- Your Highlight on page 3 | Location 184-185",
"",
"This is a test highlight.",
]
expected = ("3", "184-185", "")
expected = ("3", "184-185", "", False)

# When
actual = _parse_page_location_and_date(raw_clipping_list)
actual = _parse_page_location_date_and_note(raw_clipping_list)

# Then
assert expected == actual


def test_parse_page_location_and_date_should_parse_the_location_and_date_when_there_is_no_page():
def test_parse_page_location_date_and_note_should_parse_the_location_and_date_when_there_is_no_page():
# Given
raw_clipping_list = [
"Relativity (Albert Einstein)",
"Location 184-185 | Added on Friday, April 30, 2021 12:31:29 AM",
"",
"This is a test highlight.",
]
expected = ("", "184-185", "Friday, 30 April 2021 12:31:29 AM")
expected = ("", "184-185", "Friday, 30 April 2021 12:31:29 AM", False)

# When
actual = _parse_page_location_and_date(raw_clipping_list)
actual = _parse_page_location_date_and_note(raw_clipping_list)

# Then
assert expected == actual


def test_parse_page_location_and_date_should_parse_the_page_and_date_when_there_is_no_location():
def test_parse_page_location_date_and_note_should_parse_the_page_and_date_when_there_is_no_location():
# Given
raw_clipping_list = [
"Relativity (Albert Einstein)",
"- Your Highlight on page 3 | Added on Friday, April 30, 2021 12:31:29 AM",
"",
"This is a test highlight.",
]
expected = ("3", "", "Friday, 30 April 2021 12:31:29 AM")
expected = ("3", "", "Friday, 30 April 2021 12:31:29 AM", False)

# When
actual = _parse_page_location_and_date(raw_clipping_list)
actual = _parse_page_location_date_and_note(raw_clipping_list)

# Then
assert expected == actual
Expand Down

0 comments on commit 8c2155e

Please sign in to comment.