def test_07_checkout_with_random_sample_without_seed(self): self.set_up_test() data_path = api.checkout('dataset', self.dataset_tag, {'random': '1:2'}) self._checkout_fail(data_path)
def test_31_checkout_with_entity_name(self): self.set_up_test() data_path = api.checkout(DATASETS, DATASET_NAME) self.assertEqual(self.data_path, data_path) self.check_metadata() self.assertTrue(os.path.exists(self.file1)) self.assertTrue(os.path.exists(self.file2))
def test_28_checkout_tag_with_invalid_entity(self): try: self.set_up_test() data_path = api.checkout('dataset_invalid', self.dataset_tag) self.assertEqual(self.data_path, data_path) self.check_metadata() self.assertTrue(False) except Exception as e: self.assertIn(output_messages['ERROR_INVALID_ENTITY_TYPE'] % EntityType.to_list(), str(e))
def test_04_checkout_with_random_sample(self): self.set_up_test() data_path = api.checkout(DATASETS, self.dataset_tag, {'random': '1:2', 'seed': '1'}) self.assertEqual(self.data_path, data_path) self.check_metadata() self.assertFalse(os.path.exists(self.file1)) self.assertTrue(os.path.exists(self.file2)) self.assertFalse(os.path.exists(self.file3)) self.assertTrue(os.path.exists(self.file4))
def test_01_checkout_tag(self): self.set_up_test() data_path = api.checkout(DATASETS, self.dataset_tag) self.assertEqual(self.data_path, data_path) self.check_metadata() self.assertTrue(os.path.exists(self.file1)) self.assertTrue(os.path.exists(self.file2)) self.assertTrue(os.path.exists(self.file3)) self.assertTrue(os.path.exists(self.file4))
def test_03_checkout_with_range_sample(self): self.set_up_test() data_path = api.checkout('dataset', self.dataset_tag, {'range': '0:4:3'}) self.assertEqual(self.data_path, data_path) self.check_metadata() self.assertTrue(os.path.exists(self.file1)) self.assertFalse(os.path.exists(self.file2)) self.assertTrue(os.path.exists(self.file3)) self.assertFalse(os.path.exists(self.file4))
def test_02_checkout_with_group_sample(self): self.set_up_test() data_path = api.checkout('dataset', self.dataset_tag, { 'group': '1:2', 'seed': '10' }) self.assertEqual(self.data_path, data_path) self.check_metadata() self.assertTrue(os.path.exists(self.file1)) self.assertFalse(os.path.exists(self.file2)) self.assertFalse(os.path.exists(self.file3)) self.assertTrue(os.path.exists(self.file4))
def test_06_checkout_with_range_sample_without_range(self): self.set_up_test() data_path = api.checkout(DATASETS, self.dataset_tag, {'seed': '10'}) self._checkout_fail(data_path)
def test_05_checkout_with_group_sample_without_group(self): self.set_up_test() data_path = api.checkout('dataset', self.dataset_tag, {'seed': '10'}) self._checkout_fail(data_path)