-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for the get_dataset_attributes helper function
- Loading branch information
1 parent
a8221ea
commit 933a912
Showing
2 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
"""Unit tests module for the helper functions""" | ||
import unittest | ||
from tpv.commands.test import mock_galaxy | ||
from tpv.core.helpers import get_dataset_attributes | ||
|
||
|
||
class TestHelpers(unittest.TestCase): | ||
"""Tests for helper functions""" | ||
def test_get_dataset_attributes(self): | ||
"""Test that the function returns a dictionary with the correct attributes""" | ||
job = mock_galaxy.Job() | ||
job.add_input_dataset( | ||
mock_galaxy.DatasetAssociation( | ||
"test", | ||
mock_galaxy.Dataset("test.txt", file_size=7*1024**3, object_store_id="files1") | ||
) | ||
) | ||
dataset_attributes = get_dataset_attributes(job.input_datasets) | ||
expected_result = {0: {'object_store_id': 'files1', 'size': 7*1024**3}} | ||
self.assertEqual(dataset_attributes, expected_result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters