Skip to content

Commit

Permalink
fixes issue #512
Browse files Browse the repository at this point in the history
  • Loading branch information
proccaserra committed Nov 12, 2023
1 parent 2f489f5 commit 034291f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/model/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from unittest import TestCase

from isatools.tests import utils
from isatools.model.datafile import DataFile
from isatools.model.sample import Sample
from isatools.model.material import Material, Extract, LabeledExtract
Expand All @@ -14,9 +15,15 @@
compute_checksum
)

import os


class TestUtils(TestCase):

def setUp(self):
self._tab_data_dir = utils.TAB_DATA_DIR
# self._tmp_dir = tempfile.mkdtemp()

def test_empty_process_sequence(self):
graph = _build_assay_graph()
self.assertTrue(len(graph.indexes.keys()) == 0)
Expand Down Expand Up @@ -106,12 +113,12 @@ def test_batch_create_assays(self):

def test_checksum_md5(self):
isa_data_file = DataFile(filename="EVHINN101.sff", label="RawDataFile")
updated_isa_data_file = compute_checksum("../data/tab/BII-S-3/", isa_data_file, "md5")
updated_isa_data_file = compute_checksum(os.path.join(self._tab_data_dir, "BII-S-3"), isa_data_file, "md5")
self.assertEqual(updated_isa_data_file.comments[0].value, "md5")
self.assertEqual(updated_isa_data_file.comments[1].value, "d41d8cd98f00b204e9800998ecf8427e")

def test_checksum_sha2(self):
isa_data_file = DataFile(filename="EVHINN101.sff", label="RawDataFile")
updated_isa_data_file = compute_checksum("../data/tab/BII-S-3/", isa_data_file, "sha256")
updated_isa_data_file = compute_checksum(os.path.join(self._tab_data_dir, "BII-S-3"), isa_data_file, "sha256")
self.assertEqual(updated_isa_data_file.comments[0].value, "sha256")
self.assertEqual(updated_isa_data_file.comments[1].value, "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")

0 comments on commit 034291f

Please sign in to comment.