示例#1
0
def test_str2result_no_zerofill():
    """
    Ensure zeros are striped from the start of the site code.

    The Red Cross sends zero-filled site codes but every form of
    reference at the AVRC from papers/bar codes/index cards does
    not use the zeros and so including them into the database
    would destroy the workflow ecosystem.
    """
    value = '0099G12345'
    result = parser.str2result(value)
    eq_(result.site_code, '99G')
示例#2
0
 def assert_nucleic(start, prop):
     """Helper method to assert all possible test results"""
     fill = 'XXXX YYYYY'.ljust(start)
     for value in ('P', 'N', 'NT'):
         result = parser.str2result(fill + value)
         eq_(getattr(result, prop), value)
示例#3
0
def test_oakland_east_bay_sample():
    value = '076GH12345'
    eq_(parser.str2result(value).site_code, '76GH')
    eq_(parser.str2result(value).reference_number, '12345')
示例#4
0
def test_ucsd_sample():
    value = '076C 12345'
    eq_(parser.str2result(value).site_code, '76C')
    eq_(parser.str2result(value).reference_number, '12345')
示例#5
0
def test_str2result_sample():
    value = '1234 67890123456'
    eq_(parser.str2result(value).site_code, '1234')
    eq_(parser.str2result(value).reference_number, '67890')
示例#6
0
def test_str2result_invalid():
    parser.str2result(None)
示例#7
0
 def assert_blood(start, prop):
     """ Helper method to assert blood test result"""
     fill = 'XXXX YYYYY'.ljust(start)
     for value in ('O+', 'O-', 'A+', 'A-', 'B+', 'B-', 'AB+', 'AB-'):
         result = parser.str2result(fill + value)
         eq_(getattr(result, prop), value)