def test_getSamples1(self): lab1 = Labels(self.lab1_dsv) samples1 = lab1.getSamples(self.lab1_samples1) self.assertEqual(self.lab1_samples_resp1, samples1) samples2 = lab1.getSamples(self.lab1_samples2) self.assertEqual(self.lab1_samples_resp2, samples2) samples3 = lab1.getSamples(self.lab1_samples3) self.assertEqual(self.lab1_samples_resp3, samples3) samples4 = lab1.getSamples(self.lab1_samples4) self.assertEqual(self.lab1_samples_resp4, samples4) samples5 = lab1.getSamples(self.lab1_samples5) self.assertEqual(self.lab1_samples_resp5, samples5) samples6 = lab1.getSamples(self.lab1_samples6) self.assertEqual(self.lab1_samples_resp6, samples6)
def test_getLabels1(self): lab = Labels(self.lab1_dsv) resp1 = lab.getLabels(self.lab1_samples1) self.assertEqual(self.lab1_resp1, resp1) resp2 = lab.getLabels(self.lab1_samples2) self.assertEqual(self.lab1_resp2, resp2) resp3 = lab.getLabels(self.lab1_samples3) self.assertEqual(self.lab1_resp3, resp3) resp4 = lab.getLabels(self.lab1_samples4) self.assertEqual(self.lab1_resp4, resp4) resp5 = lab.getLabels(self.lab1_samples5) self.assertEqual(self.lab1_resp5, resp5) resp6 = lab.getLabels(self.lab1_samples6) self.assertEqual(self.lab1_resp6, resp6)
def test_getLabels4(self): lab = Labels(self.lab2_dsv) resp1 = lab.getLabels(self.lab1_samples1, as_array=True) num1 = np.array([float(l) for l in self.lab1_resp1]) np.testing.assert_array_equal(resp1, num1) resp2 = lab.getLabels(self.lab1_samples2, as_array=True) num2 = np.array([float(l) for l in self.lab1_resp2]) np.testing.assert_array_equal(resp2, num2) resp3 = lab.getLabels(self.lab1_samples3, as_array=True) num3 = np.array([float(l) for l in self.lab1_resp3]) np.testing.assert_array_equal(resp3, num3) resp4 = lab.getLabels(self.lab1_samples4, as_array=True) num4 = np.array([float(l) for l in self.lab1_resp4]) np.testing.assert_array_equal(resp4, num4) resp5 = lab.getLabels(self.lab1_samples5, as_array=True) num5 = np.array([float(l) for l in self.lab1_resp5]) np.testing.assert_array_equal(resp5, num5) resp6 = lab.getLabels(self.lab1_samples6, as_array=True) num6 = np.array([float(l) for l in self.lab1_resp6]) np.testing.assert_array_equal(resp6, num6)
def test_init2(self): lab = Labels(self.lab1_dsv, unused_sample_label='XXX') self.assertEqual('XXX', lab.unused_sample_label) self.assertEqual(self.lab1_cnt, lab.labels)
def test_init1(self): lab = Labels(self.lab1_dsv) self.assertEqual(self.lab1_cnt, lab.labels) self.assertEqual('0', lab.unused_sample_label)
def test_getSamples2(self): lab2 = Labels(self.lab2_dsv) samples1 = lab2.getSamples(self.lab2_samples_order1) self.assertEqual(self.lab2_samples_resp1, samples1) samples2 = lab2.getSamples(self.lab2_samples_order2) self.assertEqual(self.lab2_samples_resp2, samples2)