Test Submodules

Module contents

Tests for ToDonePy

tests.test_ToDoneCLI

tests.test_ToDoneCLI.test_to_do_custom_file(tmp_path)

Run to do with existing custom file

tests.test_ToDoneCLI.test_to_doing_custom_file(tmp_path)

Run to doing with existing custom file

tests.test_ToDoneCLI.test_to_doing_custom_file_graphic_flag(tmp_path)

Run to doing with the –graphic flag

tests.test_ToDoneCLI.test_to_doing_custom_file_sort_flag(tmp_path)

Run to doing with the –sort flag

tests.test_ToDoneCLI.test_to_done_custom_file(tmp_path)

Run to done with existing custom file

tests.test_filer

tests.test_filer.test_Filer_append_existing_file(tmp_path: pathlib.Path, content: str = '1\tMake Tests\n2\tRun Tests\n', new_contents: List[List[str]] = [['3', 'More tests'], ['4', 'Most tests']]) → None

Run Filer to append to an existing file

Tmp_path

Where to create temporary file

Content

Contents of temporary file

New_contents

Contents to be added to file

Returns

None

tests.test_filer.test_Filer_delete_existing_file_successful(tmp_path: pathlib.Path, content: str = '3\tMore Tests\n2\tMake Tests\n1\tRun Tests\n') → None

Run Filer to delete a line from an existing file

Tmp_path

Where to create temporary file

Content

Contents of temporary file

Returns

None

tests.test_filer.test_Filer_delete_existing_file_unsuccessful(tmp_path: pathlib.Path, content: str = '3\tMore Tests\n2\tMake Tests\n1\tRun Tests\n') → None

Run Filer to delete a non-existent line

Tmp_path

Where to create temporary file

Content

Contents of temporary file

Returns

None

tests.test_filer.test_Filer_no_create(tmp_path: pathlib.Path) → None

Run Filer to read a file that does not exist

Tmp_path

Where to create temporary file

Returns

None

tests.test_filer.test_Filer_read_existing_file(tmp_path: pathlib.Path, content: str = '1\tMake Tests\n2\tRun Tests') → None

Run Filer to read an existing file

Tmp_path

Where to create temporary file

Content

Contents of temporary file

Returns

None

tests.test_filer.test_Filer_read_new_file(tmp_path: pathlib.Path) → None

Run Filer to read and create a new file

Tmp_path

Where to create temporary file

Returns

None

tests.test_filer.test_Filer_sort_existing_file(tmp_path: pathlib.Path, content: str = '3\tMore Tests\n2\tMake Tests\n1\tRun Tests\n') → None

Run Filer to sort an existing file

Tmp_path

Where to create temporary file

Content

Contents of temporary file

Returns

None

tests.test_filer.test_Filer_write_existing_file(tmp_path: pathlib.Path, content: str = '1\tMake Tests\n2\tRun Tests', new_contents: List[List[str]] = [['3', 'More tests'], ['4', 'Most tests']]) → None

Run Filer to write to an existing file

Tmp_path

Where to create temporary file

Content

Contents of temporary file

New_contents

Contents to be written to file

Returns

None

tests.test_file_len

tests.test_file_len.test_file_len(tmp_path: pathlib.Path, contents: str = 'a\nb\nc\nd\ne\n') → None

Run ToDonePy.file_len on a file with 5 lines

Tmp_path

Where to create temporary file

Contents

What to write to temporary file

Returns

None

tests.test_file_len.test_file_len_raise_error() → None

Run ToDonePy.file_len on a file that doesn’t exist

Returns

None

tests.test_notify

tests.test_notify.test_notify_send(summary: str = 'Test', body: str = 'Testing testing 1, 2, 3', urgency: str = 'low', expire_time: int = 1000) → None

Test a basic notification with notify_send

Summary

Title of notification

Body

Body of notification

Urgency

Urgency of notification. Must be in [‘low’, ‘normal’, ‘critical’]

Expire_time

Time, in ms, to display notification

Returns

None

tests.test_notify.test_notify_send_invalid_urgency(summary: str = 'Test', body: str = 'Testing testing 1, 2, 3', urgency: str = 'not in list', expire_time: int = 1000) → None

Test notify_send with an invalid parameter

Summary

Title of notification

Body

Body of notification

Urgency

Urgency of notification. Must be in [‘low’, ‘normal’, ‘critical’]

Expire_time

Time, in ms, to display notification

Returns

None

tests.test_counted_list

tests.test_counted_list.test_counted_list_equal_to(lines: List[List[str]] = [['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i']], number: int = 3, connector: str = ' ') → None

Run counted_list with number greater than length

Lines

List containing items to be echoed

Number

Number of strings to be echoed

Connector

For pretty printing. What to join entries with

Returns

None

tests.test_counted_list.test_counted_list_greater_than(lines: List[List[str]] = [['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i']], number: int = 4, connector: str = ' ') → None

Run counted_list with number greater than length

Lines

List containing items to be echoed

Number

Number of strings to be echoed

Connector

For pretty printing. What to join entries with

Returns

None

tests.test_counted_list.test_counted_list_less_than(lines: List[List[str]] = [['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i']], number: int = 2, connector: str = ' ') → None

Run counted_list with number less than length

Lines

List containing items to be echoed

Number

Number of strings to be echoed

Connector

For pretty printing. What to join entries with

Returns

None

tests.make_temp

tests.make_temp.make_file(tmp_path: pathlib.Path, content: str = '') → pathlib.Path

Helper function to create a temporary file

Temp_path

Temporary path for pytest

Contets

Contents to be written to temporary file

Returns

Temporary file for pytest

tests.make_temp.make_path(tmp_path: pathlib.Path) → pathlib.Path

Helper function to create a pathlib Path object.

Temp_path

Temporary path for pytest

Returns

Temporary file path for pytest