Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 def test_no_rbc_key_valid_nucs(self):
     metrics = mock.MagicMock()
     name = xlsites._get_random_barcode('_____:AAA', metrics)
     self.assertEqual(name, 'AAA')
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
 def test_good_name(self):
     name = xlsites._get_random_barcode('_____:rbc:AAA:____',
                                        mock.MagicMock())
     self.assertEqual(name, 'AAA')