add parentheses to alias field to disambiguate form entry

This commit is contained in:
Jacob Zaval 2017-09-14 15:00:08 -07:00
Родитель a203047f69
Коммит effda320ee
2 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -22,7 +22,7 @@ class FormInstructions:
def get_user_sequence(self, user) -> str:
try:
user_sequence = [barcode.SPACE, user, barcode.ENTER, barcode.TAB]
user_sequence = [barcode.SPACE, f'({user})', barcode.ENTER, barcode.TAB]
return ''.join([barcode.delayify(char) for char in user_sequence])
except TypeError('User entry is required.'):
sys.exit(1)

Просмотреть файл

@ -9,4 +9,4 @@ def test_form_instructions_object_instantiates():
def test_get_instructions_method():
instructions = form_instructions.FormInstructions(MAC_SYSTEM_SPECS)
assert instructions.new_asset('1234567', 'admin',
'Desktop') == '~d1234567~d~t~d ~dMacPro6,1~d~e~d~t~d3.7 GHz Quad-Core Intel Xeon E5~d~t~d32 GB~d~t~d3.0 TB HDD (APPLE HDD ST3000DM001)~d~t~d121.3 GB SSD (APPLE SSD SM0128G)~d~t~d~t~d~t~d ~dReady~d~e~d~t~d ~dadmin~d~e~d~t~dF5KQH0P9F9VN'
'Desktop') == '~d1234567~d~t~d ~dMacPro6,1~d~e~d~t~d3.7 GHz Quad-Core Intel Xeon E5~d~t~d32 GB~d~t~d3.0 TB HDD (APPLE HDD ST3000DM001)~d~t~d121.3 GB SSD (APPLE SSD SM0128G)~d~t~d~t~d~t~d ~dReady~d~e~d~t~d ~d(admin)~d~e~d~t~dF5KQH0P9F9VN'