Automated Tests¶
- Tpdd automated tests
- Automated tests for the Tpdd class
Tpdd_test.py Copyright 2016 - Gary Hammond email gfhammond@gmail.com
Unit tests for the Tpdd class
The unit tests require a physical TPDD to be connected to the serial port with a disk in the drive. The disk can be formatted as part of the tests so make sure that the disk is one that is ok to be wiped.
Attributes that must be used with the tests are:
- no-tpdd - For tests not requiring a TPDD to be connected.
- tpdd-off - For tests that check for correct behaviour when there is a lack of communication with a TPDD
- no-disk - For tests that check for correct behaviour when there is no disk in the drive
- disk - For disk operation tests.
- format - Used for the disk formatting test.
If the test suite is run without specifying attributes, it will report failures!
Example test run with the disk in a TPDD2 drive:
nosetests -v .\Tpdd_test.py -a 'disk' -a 'tpdd2' -a 'format'
-
Tpdd_test.
test_copy_file_from_bank_1
()[source]¶ If the disk is a TPDD 2 disk do the test again on the second bank
-
Tpdd_test.
test_copy_file_to_bank_1
()[source]¶ If the disk is a TPDD 2 disk do the test again on the second bank
-
Tpdd_test.
test_delete_file_from_bank_1
()[source]¶ If the disk is a TPDD 2 disk do the test again on the second bank
-
Tpdd_test.
test_dir_empty_disk_bank_0
()[source]¶ Check to see if any empty disk reports the correct number of bytes
-
Tpdd_test.
test_dir_empty_disk_bank_1
()[source]¶ Check that an empty disks reports the correct number of bytes on bank 1
-
Tpdd_test.
test_file_exists_bank_1
()[source]¶ If the disk is a TPDD 2 disk do the test again on the second bank
-
Tpdd_test.
test_file_not_exists_bank_0
()[source]¶ Checks the file exists method with non-existent files
-
Tpdd_test.
test_file_not_exists_bank_1
()[source]¶ If the disk is a TPDD 2 disk do the test again on the second bank
-
Tpdd_test.
test_parse_valid_return_code_item
()[source]¶ Test valid return code items. The last test item is an invalid code however the format of the return message is valid.
-
Tpdd_test.
test_rename_invalid_file_bank_0
()[source]¶ Checks the file rename method with invalid filenames
-
Tpdd_test.
test_rename_invalid_file_bank_1
()[source]¶ If the disk is a TPDD 2 disk do the test again on the second bank
-
Tpdd_test.
test_rename_valid_file_bank_0
()[source]¶ Checks the file rename method with valid filenames
-
Tpdd_test.
test_rename_valid_file_bank_1
()[source]¶ If the disk is a TPDD 2 disk do the test again on the second bank