def test_bad_name(self): metrics = mock.MagicMock() metrics.norandomer_recs = 0 name = xlsites._get_random_barcode('blah', metrics) self.assertEqual(name, '') self.assertEqual(metrics.norandomer_recs, 1)
def test_no_rbc_key_valid_nucs(self): metrics = mock.MagicMock() name = xlsites._get_random_barcode('_____:AAA', metrics) self.assertEqual(name, 'AAA')
def test_no_rbc_key_invalid_nucs(self): metrics = mock.MagicMock() metrics.invalidrandomer_recs = 0 name = xlsites._get_random_barcode('_____:AAB', metrics) self.assertEqual(name, '') self.assertEqual(metrics.invalidrandomer_recs, 1)
def test_good_name(self): name = xlsites._get_random_barcode('_____:rbc:AAA:____', mock.MagicMock()) self.assertEqual(name, 'AAA')