Skip to content

Commit

Permalink
tests: convert qpc utils tests to pytests
Browse files Browse the repository at this point in the history
  - Convert qpc/tests_qpc_utils.py to pytests
  • Loading branch information
abellotti committed Jul 17, 2023
1 parent b45a46d commit 32f04dd
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions qpc/tests_qpc_utils.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
"""Test the utils module."""

import os
import unittest

from qpc import utils


class UtilsTests(unittest.TestCase):
class TestUtils:
"""Class for testing the utils module qpc."""

def test_read_client_token(self):
Expand All @@ -18,9 +17,9 @@ def test_read_client_token(self):
token_json = {"token": expected_token}
utils.write_client_token(token_json)
token = utils.read_client_token()
self.assertTrue(isinstance(token, str))
assert isinstance(token, str)
if check_value:
self.assertEqual(token, expected_token)
assert token == expected_token

def test_extract_json_from_tarfile(self):
"""Test extracting json from tarfile."""
Expand All @@ -35,4 +34,4 @@ def test_extract_json_from_tarfile(self):
test_file = {"test.json": report_json}
fileobj = utils.create_tar_buffer(test_file)
json = utils.extract_json_from_tar(fileobj, print_pretty=False)
self.assertEqual(json, report_json)
assert json == report_json

0 comments on commit 32f04dd

Please sign in to comment.